Uh oh!
There was an error while loading. Please reload this page.
lib: enforce use of Array from primordials - #30635
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
hmm, wait, but why is Object.setPrototypeOf(..., null) removed here?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
I see. To me making the Array namespace less mutable takes precedence over keeping these functions away from prototype poisoning, so LGTM.
nodejs-github-bot
commented
Nov 25, 2019
nodejs-github-bot
commented
Nov 25, 2019
nodejs-github-bot
commented
Nov 26, 2019
b904161 to
5f67c62Comparenodejs-github-bot
commented
Nov 26, 2019
nodejs-github-bot
commented
Nov 26, 2019
nodejs-github-bot
commented
Nov 27, 2019
There was a problem hiding this comment.
I see. To me making the Array namespace less mutable takes precedence over keeping these functions away from prototype poisoning, so LGTM.
5f67c62 to
cf1f94bComparePR-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
Landed in 141a6e3 |
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>
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>
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>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes