FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: enforce use of Array from primordials by targos · Pull Request #30635 · nodejs/node · GitHub

/ node Public

lib: enforce use of Array from primordials - #30635

Closed
targos wants to merge 1 commit into
nodejs:masterfrom
targos:primordials-array
Closed

lib: enforce use of Array from primordials#30635
targos wants to merge 1 commit into
nodejs:masterfrom
targos:primordials-array

Conversation

targos commented Nov 25, 2019

Copy link
Copy Markdown
Member
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Nov 25, 2019
Comment thread lib/internal/per_context/primordials.js Outdated

targos Nov 25, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This change is necessary, for two reasons:

  • Some of the arrays we create are returned to the user
  • Without it I'd also have to change calls to array methods

Also, It's probably better not to wrap the primordial functions for performance reasons, especially when we migrate String() and Number() calls in the future.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

hmm, wait, but why is Object.setPrototypeOf(..., null) removed here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Because if we stop wrapping the functions, it becomes useless, as there is nothing left to set the prototype of (we can't do that directly on the original functions).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I see. To me making the Array namespace less mutable takes precedence over keeping these functions away from prototype poisoning, so LGTM.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

targos requested a review from joyeecheung November 27, 2019 07:11

Copy link
Copy Markdown
Collaborator

joyeecheung previously approved these changes Nov 27, 2019

joyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Rubber Stamp LGTM

Comment thread lib/internal/per_context/primordials.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I see. To me making the Array namespace less mutable takes precedence over keeping these functions away from prototype poisoning, so LGTM.

targos added a commit that referenced this pull request Nov 27, 2019
PR-URL: #30635
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

targos commented Nov 27, 2019

Copy link
Copy Markdown
Member Author

Landed in 141a6e3

targos closed this Nov 27, 2019
targos deleted the primordials-array branch November 27, 2019 18:32
targos added a commit that referenced this pull request Dec 1, 2019
PR-URL: #30635
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
BridgeAR mentioned this pull request Dec 3, 2019
targos added a commit that referenced this pull request Jan 14, 2020
PR-URL: #30635
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
PR-URL: #30635
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
MylesBorins mentioned this pull request Feb 8, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL