Fail early, in modern GENERIC
builds, if globalThis
isn't available (PR 11799 follow-up, issue 12596)
It probably doesn't hurt to explicitly check for `globalThis` as well, in addition to the existing checks.
This commit is contained in:
parent
e3851a6765
commit
a03b383edb
@ -143,13 +143,14 @@ class WorkerMessageHandler {
|
|||||||
// `ReadableStream` and `Promise.allSettled`).
|
// `ReadableStream` and `Promise.allSettled`).
|
||||||
if (
|
if (
|
||||||
(typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) &&
|
(typeof PDFJSDev === "undefined" || PDFJSDev.test("SKIP_BABEL")) &&
|
||||||
(typeof ReadableStream === "undefined" ||
|
(typeof globalThis === "undefined" ||
|
||||||
|
typeof ReadableStream === "undefined" ||
|
||||||
typeof Promise.allSettled === "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. " +
|
"functionality used by the PDF.js library (e.g. `globalThis`, " +
|
||||||
"`ReadableStream` and/or `Promise.allSettled`); " +
|
"`ReadableStream`, and/or `Promise.allSettled`); " +
|
||||||
"please use an ES5-compatible build instead."
|
"please use an ES5-compatible build instead."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user