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

Re-factor the isLittleEndian/isEvalSupported caching #14751

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

  • Re-factor the isLittleEndian/isEvalSupported caching

    This functionality is very old, hence we should be able to improve the caching a little bit with modern JavaScript features.

  • Slightly simplify the Catalog._readMarkInfo method

    We don't need to first check if the Dictionary contains the key, since trying to get a non-existent key simply returns undefined and we're already ensuring that the value is a boolean.
    Furthermore, we shouldn't need to worry about the Object.prototype containing enumerable properties since the checks (in src/core/worker.js) done for Array.prototype indirectly also cover Objects. (Keep in mind that an Array is just a special kind of Object in JavaScript.)

This functionality is very old, hence we should be able to improve the caching a little bit with modern JavaScript features.
We don't need to first check if the Dictionary contains the key, since trying to get a non-existent key simply returns `undefined` and we're already ensuring that the value is a boolean.
Furthermore, we shouldn't need to worry about the `Object.prototype` containing enumerable properties since the checks (in `src/core/worker.js`) done for `Array.prototype` *indirectly* also cover `Object`s. (Keep in mind that an `Array` is just a special kind of `Object` in JavaScript.)
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/1db9fd777e5d5e8/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/daadd7aeba3fe84/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/1db9fd777e5d5e8/output.txt

Total script time: 24.44 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 7
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/1db9fd777e5d5e8/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2022

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/daadd7aeba3fe84/output.txt

Total script time: 26.76 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/daadd7aeba3fe84/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij merged commit 106b69a into mozilla:master Apr 8, 2022
@timvandermeij
Copy link
Contributor

Looks good; thanks!

@Snuffleupagus Snuffleupagus deleted the isLittleEndian-isEvalSupported branch April 8, 2022 18:28
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.

None yet

3 participants