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

Use private fields in a few more viewer classes #15663

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

These properties were always intended to be private, so let's use modern JS features to actually enforce that.

These properties were always intended to be *private*, so let's use modern JS features to actually enforce that.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Nov 4, 2022

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/61d1e17e5710699/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 4, 2022

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/58176c3b1d24673/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 4, 2022

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/58176c3b1d24673/output.txt

Total script time: 2.36 mins

  • Unit Tests: Passed

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Looking at #listeners, I think we should replace such map objects by real Map, just to make clearer the role these kind of objects have.

@pdfjsbot
Copy link

pdfjsbot commented Nov 4, 2022

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/61d1e17e5710699/output.txt

Total script time: 10.30 mins

  • Unit Tests: Passed

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Nov 4, 2022

Looking at #listeners, I think we should replace such map objects by real Map, just to make clearer the role these kind of objects have.

I've been thinking about that (more generally), but there's some performance issues with Maps compared to regular Objects. In particular Map.prototype.set() is a lot slower than just assigning to an Object, at least in Firefox, please find some context in master...Snuffleupagus:pdf.js:Dict-Map

@Snuffleupagus Snuffleupagus merged commit 0b27d70 into mozilla:master Nov 4, 2022
@Snuffleupagus Snuffleupagus deleted the viewer-classes-private-fields branch November 4, 2022 14:51
@calixteman
Copy link
Contributor

Looking at #listeners, I think we should replace such map objects by real Map, just to make clearer the role these kind of objects have.

I've been thinking about that (more generally), but there's some performance issues with Maps compared to regular Objects. In particular Map.prototype.set() is a lot slower than just assigning to an Object, at least in Firefox, please find some context in master...Snuffleupagus:pdf.js:Dict-Map

I filed a bug about that: https://bugzilla.mozilla.org/show_bug.cgi?id=1799154

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