diff --git a/gulpfile.js b/gulpfile.js index 431675136..e197e7155 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -224,6 +224,12 @@ function createWebpackConfig(defines, output) { loose: true, }, ], + [ + "@babel/plugin-proposal-optional-chaining", + { + loose: true, + }, + ], "@babel/plugin-transform-modules-commonjs", [ "@babel/plugin-transform-runtime", diff --git a/package.json b/package.json index 8f8d56235..54ab7c993 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", + "@babel/plugin-proposal-optional-chaining": "^7.11.0", "@babel/plugin-transform-modules-commonjs": "^7.10.4", "@babel/plugin-transform-runtime": "^7.11.5", "@babel/preset-env": "^7.11.5", diff --git a/web/app.js b/web/app.js index fa9070834..252fdbc07 100644 --- a/web/app.js +++ b/web/app.js @@ -846,7 +846,7 @@ const PDFViewerApplication = { return undefined; // Ignore errors for previously opened PDF files. } - const message = exception && exception.message; + const message = exception?.message; let loadingErrorMessage; if (exception instanceof InvalidPDFException) { // change error message also for other builds