[api-minor] Remove calling getDocument
directly with a PDFDataRangeTransport
-instance (PR 15943 follow-up)
This was deprecated in PR 15943, which has now been included in two official PDF.js releases. Given that `PDFDataRangeTransport` is somewhat unlikely to be used outside of the *built-in* Firefox PDF Viewer, it doesn't seem necessary to wait longer before removing this. Also, removes the specific error-message for GENERIC builds to not unnecessarily "advertise" using non-objects when calling the `getDocument`-function. *Please note:* This patch is written using the GitHub UI, since I'm currently without a dev machine, so hopefully it works correctly.
This commit is contained in:
parent
d4216264e8
commit
ceec93c832
@ -255,21 +255,9 @@ function getDocument(src) {
|
||||
src = { url: src };
|
||||
} else if (isArrayBuffer(src)) {
|
||||
src = { data: src };
|
||||
} else if (src instanceof PDFDataRangeTransport) {
|
||||
deprecated(
|
||||
"`PDFDataRangeTransport`-instance, " +
|
||||
"please use a parameter object with `range`-property instead."
|
||||
);
|
||||
src = { range: src };
|
||||
} else {
|
||||
if (typeof src !== "object") {
|
||||
throw new Error(
|
||||
"Invalid parameter in getDocument, " +
|
||||
"need either string, URL, TypedArray, or parameter object."
|
||||
);
|
||||
}
|
||||
}
|
||||
} else if (typeof src !== "object") {
|
||||
}
|
||||
if (typeof src !== "object") {
|
||||
throw new Error("Invalid parameter in getDocument, need parameter object.");
|
||||
}
|
||||
if (!src.url && !src.data && !src.range) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user