mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +02:00
Merge pull request #17691 from Snuffleupagus/createWebpackAlias
Move the `alias`-building out of the `createWebpackConfig` function
This commit is contained in:
commit
e8da59c6b1
3 changed files with 88 additions and 88 deletions
|
@ -11,7 +11,7 @@ function isPDFJSPreprocessor(obj) {
|
|||
}
|
||||
|
||||
function evalWithDefines(code, defines) {
|
||||
if (!code || !code.trim()) {
|
||||
if (!code?.trim()) {
|
||||
throw new Error("No JavaScript expression given");
|
||||
}
|
||||
return vm.runInNewContext(code, defines, { displayErrors: false });
|
||||
|
@ -56,12 +56,7 @@ function handlePreprocessorAction(ctx, actionName, args, path) {
|
|||
throw new Error("Unsupported action");
|
||||
} catch (e) {
|
||||
throw path.buildCodeFrameError(
|
||||
"Could not process " +
|
||||
PDFJS_PREPROCESSOR_NAME +
|
||||
"." +
|
||||
actionName +
|
||||
": " +
|
||||
e.message
|
||||
`Could not process ${PDFJS_PREPROCESSOR_NAME}.${actionName}: ${e.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
2
external/builder/builder.mjs
vendored
2
external/builder/builder.mjs
vendored
|
@ -84,7 +84,7 @@ function preprocess(inFilename, outFilename, defines) {
|
|||
out.push(line);
|
||||
};
|
||||
function evaluateCondition(code) {
|
||||
if (!code || !code.trim()) {
|
||||
if (!code?.trim()) {
|
||||
throw new Error("No JavaScript expression given at " + loc());
|
||||
}
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue