mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +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:
parent
5107259176
commit
db4cefbac3
3 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue