lib: switch to object spread where possible#25104
Closed
BridgeAR wants to merge 1 commit intonodejs:masterfrom
Closed
lib: switch to object spread where possible#25104BridgeAR wants to merge 1 commit intonodejs:masterfrom
BridgeAR wants to merge 1 commit intonodejs:masterfrom
Conversation
Use the object spread notation instead of using Object.assign. It is not only easier to read it is also faster as of V8 6.8.
devsnek
previously approved these changes
Dec 18, 2018
Member
Author
devsnek
reviewed
Dec 18, 2018
| } | ||
|
|
||
| // Make a shallow copy so we don't clobber the user's options object. | ||
| options = Object.assign({}, options); |
Member
There was a problem hiding this comment.
i realize this isn't directly related but it would be good to avoid assigning to the argument.
Member
Author
There was a problem hiding this comment.
We do that pretty often everywhere throughout the code?
Member
There was a problem hiding this comment.
could be a separate pr i guess... i just figured as long as you're modifying a bunch of these you could change the argument name. non blocking.
devsnek
approved these changes
Dec 18, 2018
targos
approved these changes
Dec 18, 2018
hiroppy
approved these changes
Dec 18, 2018
JungMinu
approved these changes
Dec 18, 2018
lundibundi
approved these changes
Dec 18, 2018
jasnell
approved these changes
Dec 18, 2018
addaleax
approved these changes
Dec 18, 2018
lpinca
approved these changes
Dec 18, 2018
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Dec 20, 2018
Use the object spread notation instead of using Object.assign. It is not only easier to read it is also faster as of V8 6.8. PR-URL: nodejs#25104 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Member
Author
|
Landed in 4b7a530 🎉 |
tshemsedinov
added a commit
to metarhia/impress
that referenced
this pull request
Dec 20, 2018
MylesBorins
pushed a commit
that referenced
this pull request
Dec 25, 2018
Use the object spread notation instead of using Object.assign. It is not only easier to read it is also faster as of V8 6.8. PR-URL: #25104 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Merged
MylesBorins
pushed a commit
that referenced
this pull request
Dec 26, 2018
Use the object spread notation instead of using Object.assign. It is not only easier to read it is also faster as of V8 6.8. PR-URL: #25104 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
refack
pushed a commit
to refack/node
that referenced
this pull request
Jan 14, 2019
Use the object spread notation instead of using Object.assign. It is not only easier to read it is also faster as of V8 6.8. PR-URL: nodejs#25104 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the object spread notation instead of using Object.assign.
It is not only easier to read it is also faster as of V8 6.8.
Benchmark with 11.4:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes