1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Add basic support for the optional chaining operator ?.

For now we need to use a Babel-plugin, since part of our build system doesn't support this fully (e.g. Babel-loader, Webpack 4.x, and SystemJS).

While the `?.` operator will thus always be transpiled by Babel, even in modern builds, simply supporting it for development purposes seems like a step in the right direction.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
This commit is contained in:
Jonas Jenwald 2020-09-29 15:45:05 +02:00
parent 5107259176
commit db4cefbac3
3 changed files with 8 additions and 1 deletions

View file

@ -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