Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert files in the src/display/-folder to use optional chaining where possible #12595

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

By using optional chaining, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining, it's possible to reduce unnecessary code-repetition in many cases.
Note that these changes also reduce the size of the built pdf.js file, when SKIP_BABEL == true is set, and for the MOZCENTRAL build-target that result in a 0.1% filesize reduction from a simple and mostly mechanical code change.

…here possible

By using optional chaining, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining, it's possible to reduce unnecessary code-repetition in many cases.
Note that these changes also reduce the size of the *built* `pdf.js` file, when `SKIP_BABEL == true` is set, and for the `MOZCENTRAL` build-target that result in a `0.1%` filesize reduction from a simple and mostly mechanical code change.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Nov 7, 2020

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/083fd5d8e82ae8a/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 7, 2020

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/293fb12c728d306/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 7, 2020

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/083fd5d8e82ae8a/output.txt

Total script time: 24.95 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/083fd5d8e82ae8a/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Nov 7, 2020

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/293fb12c728d306/output.txt

Total script time: 27.58 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://3.101.106.178:8877/293fb12c728d306/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit b068cdb into mozilla:master Nov 7, 2020
@timvandermeij
Copy link
Contributor

Thank you for doing this!

@Snuffleupagus Snuffleupagus deleted the src-display-optional-chaining branch November 8, 2020 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants