mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Introduce more optional chaining in the src/core/
folder
After PR 12563 we're now free to use optional chaining in the worker-thread as well. (This patch also fixes one previously "missed" case in the `web/` folder.) For the MOZCENTRAL build-target this patch reduces the total bundle-size by `1.6` kilobytes.
This commit is contained in:
parent
c20c1b3362
commit
1b4a7c5965
27 changed files with 90 additions and 137 deletions
|
@ -759,7 +759,7 @@ class JpegImage {
|
|||
let endOffset = offset + length - 2;
|
||||
|
||||
const fileMarker = findNextFileMarker(data, endOffset, offset);
|
||||
if (fileMarker && fileMarker.invalid) {
|
||||
if (fileMarker?.invalid) {
|
||||
warn(
|
||||
"readDataBlock - incorrect length, current marker is: " +
|
||||
fileMarker.invalid
|
||||
|
@ -1052,7 +1052,7 @@ class JpegImage {
|
|||
/* currentPos = */ offset - 2,
|
||||
/* startPos = */ offset - 3
|
||||
);
|
||||
if (nextFileMarker && nextFileMarker.invalid) {
|
||||
if (nextFileMarker?.invalid) {
|
||||
warn(
|
||||
"JpegImage.parse - unexpected data, current marker is: " +
|
||||
nextFileMarker.invalid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue