Skip to content

Fail early, in modern GENERIC builds, if globalThis isn't available (PR 11799 follow-up, issue 12596) #12598

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

Merged
merged 1 commit into from
Nov 7, 2020
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
7 changes: 4 additions & 3 deletions src/core/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ class WorkerMessageHandler {
// `ReadableStream` and `Promise.allSettled`).
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) &&
(typeof ReadableStream === "undefined" ||
(typeof globalThis === "undefined" ||
typeof ReadableStream === "undefined" ||
typeof Promise.allSettled === "undefined")
) {
throw new Error(
"The browser/environment lacks native support for critical " +
"functionality used by the PDF.js library (e.g. " +
"`ReadableStream` and/or `Promise.allSettled`); " +
"functionality used by the PDF.js library (e.g. `globalThis`, " +
"`ReadableStream`, and/or `Promise.allSettled`); " +
"please use an ES5-compatible build instead."
);
}
Expand Down