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 more code in the /src folder to use ES6 classes, such that Util.inherit can be removed #9887

Merged
merged 6 commits into from
Jul 14, 2018

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jul 10, 2018

Compared to the time when ES6 classes were originally introduced in the /web folder, things have now improved/changed:

  • A fair number of performance improvements for ES6 classes have landed in Firefox; please see https://bugzilla.mozilla.org/show_bug.cgi?id=1167472 for details.
  • ES6 classes are now used very frequently in the Firefox front-end code.
  • There's already (some) ES6 class usage in the /src folder, with (seemingly) no ill effects.
  • By converting more code in the /src folder to use proper ES6 classes, the Util.inherit function may be replaced by native code.

Much more manageable diff with: https://github.com/mozilla/pdf.js/pull/9887/files?w=1

…141 follow-up)

PR 6141 changed `CompiledFont.compileGlyph` to, in the general case, return an Array. However, that PR apparenly forgot to update the no-glyph, empty-glyph, and endchar-glyph code-path and a String was still being (incorrectly) returned.

Given the way that `FontFaceObject.getPathGenerator` (on the API side) is implemented, this shouldn't have caused any bugs despite the Worker possible returning unexpected data.
…6 classes

Also changes `var` to `let`/`const` in code already touched in the patch.
Also changes `var` to `let`/`const` in code already touched in the patch.
Also changes `var` to `let`/`const` in code already touched in the patch.
Compared to all the other (static) methods in `Util`, the `toRoman` one looks slightly out of place. Even more so considering that `Util` is being exposed through `pdfjsLib`, where access to a Roman numerals conversion method doesn't make much sense.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/3cf1f1a3439e217/output.txt

@pdfjsbot
Copy link

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/343d41b97a99af8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/3cf1f1a3439e217/output.txt

Total script time: 24.39 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/343d41b97a99af8/output.txt

Total script time: 38.47 mins

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

@timvandermeij timvandermeij merged commit b56081c into mozilla:master Jul 14, 2018
@timvandermeij
Copy link
Contributor

timvandermeij commented Jul 14, 2018

Nice clean-up! It's really good to reduce the dependency on src/shared/util.js and use native code where possible.

@Snuffleupagus Snuffleupagus deleted the rm-Util-inherit branch July 15, 2018 09:21
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