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-lock.json b/package-lock.json index 1ac4854ba..942e3c0e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4468,16 +4468,24 @@ "dev": true }, "escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "dev": true, "requires": { "esprima": "^4.0.1", - "estraverse": "^4.2.0", + "estraverse": "^5.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1", "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "eslint": { diff --git a/package.json b/package.json index 7734b98ae..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", @@ -15,7 +16,7 @@ "core-js": "^3.6.5", "cross-env": "^7.0.2", "es-module-shims": "^0.4.7", - "escodegen": "^1.14.3", + "escodegen": "^2.0.0", "eslint": "^7.9.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-fetch-options": "^0.0.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