Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant compatibility checks, for modern generic builds, in src/core/worker.js #12878

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/core/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,15 @@ class WorkerMessageHandler {

// Ensure that (primarily) Node.js users won't accidentally attempt to use
// a non-translated/non-polyfilled build of the library, since that would
// quickly fail anyway because of missing functionality (such as e.g.
// `ReadableStream` and `Promise.allSettled`).
// quickly fail anyway because of missing functionality.
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) &&
(typeof globalThis === "undefined" ||
typeof ReadableStream === "undefined" ||
typeof Promise.allSettled === "undefined")
typeof ReadableStream === "undefined"
) {
throw new Error(
"The browser/environment lacks native support for critical " +
"functionality used by the PDF.js library (e.g. `globalThis`, " +
"`ReadableStream`, and/or `Promise.allSettled`); " +
"please use an ES5-compatible build instead."
"functionality used by the PDF.js library (e.g. `ReadableStream`); " +
"please use an `es5`-build instead."
);
}
}
Expand Down