1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

[api-minor] Remove the, now unused, pdfjsLibPromise global

This global was only introduced to work-around problems caused by the GENERIC PDF.js build using top level await. Since that was removed in the previous commit, this global is now dead code.
This commit is contained in:
Jonas Jenwald 2024-02-02 12:00:06 +01:00
parent 2643570364
commit 9418ed19e7
2 changed files with 2 additions and 17 deletions

View file

@ -445,10 +445,8 @@ function checkChromePreferencesFile(chromePrefsPath, webPrefs) {
function tweakWebpackOutput(jsName) {
const replacer = [
" __webpack_exports__ = {};",
",__webpack_exports__={};",
" __webpack_exports__ = await __webpack_exports__;",
"\\(__webpack_exports__=await __webpack_exports__\\)",
" __webpack_exports__ = {};", // Normal builds.
",__webpack_exports__={};", // Minified builds.
];
const regex = new RegExp(`(${replacer.join("|")})`, "gm");
@ -458,10 +456,6 @@ function tweakWebpackOutput(jsName) {
return ` __webpack_exports__ = globalThis.${jsName} = {};`;
case ",__webpack_exports__={};":
return `,__webpack_exports__=globalThis.${jsName}={};`;
case " __webpack_exports__ = await __webpack_exports__;":
return ` __webpack_exports__ = globalThis.${jsName} = await (globalThis.${jsName}Promise = __webpack_exports__);`;
case "(__webpack_exports__=await __webpack_exports__)":
return `(__webpack_exports__=globalThis.${jsName}=await (globalThis.${jsName}Promise=__webpack_exports__))`;
}
return match;
});