Merge pull request #12878 from Snuffleupagus/worker-compat-checks
Remove redundant compatibility checks, for modern `generic` builds, in `src/core/worker.js`
This commit is contained in:
commit
9d4bad91e2
@ -139,19 +139,15 @@ class WorkerMessageHandler {
|
|||||||
|
|
||||||
// Ensure that (primarily) Node.js users won't accidentally attempt to use
|
// Ensure that (primarily) Node.js users won't accidentally attempt to use
|
||||||
// a non-translated/non-polyfilled build of the library, since that would
|
// a non-translated/non-polyfilled build of the library, since that would
|
||||||
// quickly fail anyway because of missing functionality (such as e.g.
|
// quickly fail anyway because of missing functionality.
|
||||||
// `ReadableStream` and `Promise.allSettled`).
|
|
||||||
if (
|
if (
|
||||||
(typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) &&
|
(typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) &&
|
||||||
(typeof globalThis === "undefined" ||
|
typeof ReadableStream === "undefined"
|
||||||
typeof ReadableStream === "undefined" ||
|
|
||||||
typeof Promise.allSettled === "undefined")
|
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The browser/environment lacks native support for critical " +
|
"The browser/environment lacks native support for critical " +
|
||||||
"functionality used by the PDF.js library (e.g. `globalThis`, " +
|
"functionality used by the PDF.js library (e.g. `ReadableStream`); " +
|
||||||
"`ReadableStream`, and/or `Promise.allSettled`); " +
|
"please use an `es5`-build instead."
|
||||||
"please use an ES5-compatible build instead."
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user