1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[api-minor] Change the pageIndex, on PDFPageProxy instances, to a private property

This property has never been documented and/or *intentionally* exposed through the API, instead the `PDFPageProxy.pageNumber` property is the documented/intended API to use here.
Hence pageIndex is changed to a "private" property on `PDFPageProxy` instances, and internal API functionality is also updated to *consistently* use `this._pageIndex` rather than a mix of formats.
This commit is contained in:
Jonas Jenwald 2020-03-19 15:36:09 +01:00
parent c3f4690bde
commit ae2900e510
3 changed files with 18 additions and 16 deletions

View file

@ -505,7 +505,7 @@ describe("api", function() {
promise
.then(function(data) {
expect(data instanceof PDFPageProxy).toEqual(true);
expect(data.pageIndex).toEqual(0);
expect(data.pageNumber).toEqual(1);
done();
})
.catch(done.fail);
@ -1769,7 +1769,9 @@ describe("api", function() {
})
.catch(function(error) {
expect(error instanceof RenderingCancelledException).toEqual(true);
expect(error.message).toEqual("Rendering cancelled, page 1");
expect(error.type).toEqual("canvas");
CanvasFactory.destroy(canvasAndCtx);
done();
});