lib: enforce use of Array from primordials#30635
lib: enforce use of Array from primordials#30635targos wants to merge 1 commit intonodejs:masterfrom
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.
b904161 to
5f67c62
Compare
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
cf1f94b
Compare
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>
|
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