Merge pull request #11734 from Snuffleupagus/rm-throw-methods

Remove old API methods which were previously converted to throwing (PR 11219 follow-up)
This commit is contained in:
Tim van der Meij 2020-03-24 00:06:02 +01:00 committed by GitHub
commit 404d698dd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,20 +63,25 @@ const RENDERING_CANCELLED_TIMEOUT = 100; // ms
/** /**
* @typedef {function} IPDFStreamFactory * @typedef {function} IPDFStreamFactory
* @param {DocumentInitParameters} params The document initialization * @param {DocumentInitParameters} params - The document initialization
* parameters. The "url" key is always present. * parameters. The "url" key is always present.
* @returns {IPDFStream} * @returns {IPDFStream}
* @ignore
*/ */
/** @type IPDFStreamFactory */ /**
* @type IPDFStreamFactory
* @private
*/
let createPDFNetworkStream; let createPDFNetworkStream;
/** /**
* Sets the function that instantiates a IPDFStream as an alternative PDF data * Sets the function that instantiates an {IPDFStream} as an alternative PDF
* transport. * data transport.
* @param {IPDFStreamFactory} pdfNetworkStreamFactory - the factory function * @param {IPDFStreamFactory} pdfNetworkStreamFactory - The factory function
* that takes document initialization parameters (including a "url") and returns * that takes document initialization parameters (including a "url") and
* an instance of IPDFStream. * returns an instance of {IPDFStream}.
* @ignore
*/ */
function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) { function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
createPDFNetworkStream = pdfNetworkStreamFactory; createPDFNetworkStream = pdfNetworkStreamFactory;
@ -481,17 +486,6 @@ const PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() {
} }
}); });
} }
/**
* Registers callbacks to indicate the document loading completion.
* @ignore
*/
then(onFulfilled, onRejected) {
throw new Error(
"Removed API method: " +
"PDFDocumentLoadingTask.then, use the `promise` getter instead."
);
}
} }
return PDFDocumentLoadingTask; return PDFDocumentLoadingTask;
})(); })();
@ -972,15 +966,6 @@ class PDFPageProxy {
offsetY = 0, offsetY = 0,
dontFlip = false, dontFlip = false,
} = {}) { } = {}) {
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("GENERIC") &&
(arguments.length > 1 || typeof arguments[0] === "number")
) {
throw new Error(
"PDFPageProxy.getViewport is called with obsolete arguments."
);
}
return new PageViewport({ return new PageViewport({
viewBox: this.view, viewBox: this.view,
scale, scale,
@ -2706,17 +2691,6 @@ class RenderTask {
cancel() { cancel() {
this._internalRenderTask.cancel(); this._internalRenderTask.cancel();
} }
/**
* Registers callbacks to indicate the rendering task completion.
* @ignore
*/
then(onFulfilled, onRejected) {
throw new Error(
"Removed API method: " +
"RenderTask.then, use the `promise` getter instead."
);
}
} }
/** /**