-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
lib: replace spread operator with primordials function #54053
lib: replace spread operator with primordials function #54053
Conversation
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
thank you so much |
replaced the spread operator with ArrayPrototypeSlice to avoid reliance on user-mutable methods and enhance the safety of array iteration Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration
5e72978
to
d5eee65
Compare
fixed js lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need benchmarks to ensure this doesn't cause a regression.
@anonrig Are you referring to https://github.com/nodejs/node/blob/main/doc/contributing/writing-and-running-benchmarks.md? |
@anonrig
|
CI is completed and the following results have been produced. Could you check it?
|
Hi @MCprotein, sorry I just realised we might not have any benchmark for @anonrig do you mean to add a new a benchmark here? 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
failed tests may be flaky
|
The latest CI https://ci.nodejs.org/job/node-test-pull-request/60715/ is green 👍 @anonrig would you mind taking a look again as you are currently blocking this PR 🙏 |
@jakecastelli @anonrig |
I wrote a benchmark for |
@mcollina I have bad memory, is this fine in terms of readable-stream on npm? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
yes, this is is ok for readable-stream, we have our own primordial implementation.
Landed in d7f3730 |
@jakecastelli thank you so much. |
replaced the spread operator with ArrayPrototypeSlice to avoid reliance on user-mutable methods and enhance the safety of array iteration Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration PR-URL: #54053 Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
replaced the spread operator with ArrayPrototypeSlice to avoid reliance on user-mutable methods and enhance the safety of array iteration Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration PR-URL: #54053 Refs: https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
replaced the spread operator with ArrayPrototypeSlice to avoid reliance on user-mutable methods and enhance the safety of array iteration
Refs:
https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md#unsafe-array-iteration