| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
I wonder if it might be beneficial (performance-wise) to move this function out of fromObject() since it does not depend on any outside variables.
Sorry, something went wrong.
|
updated pull request, @mscdex |
Sorry, something went wrong.
Sorry, something went wrong.
|
Ping, how to make this PR go forward? |
Sorry, something went wrong.
There was a problem hiding this comment.
If we do this check first, we can skip the isArray check and let the if block below this, take care of the creation.
Sorry, something went wrong.
There was a problem hiding this comment.
updated, @thefourtheye .
Sorry, something went wrong.
There was a problem hiding this comment.
Even this is not necessary now
Sorry, something went wrong.
|
updated according to your comments, @thefourtheye |
Sorry, something went wrong.
There was a problem hiding this comment.
My bad. We are missing a corner case here. If the length of the array is zero we will throw an error. Perhaps we can change this to 'length' in obj.
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure about performance impact though. That said, if our tests didn't catch this case, may I ask you to update the test with empty array case?
Sorry, something went wrong.
There was a problem hiding this comment.
Not very familiar with node/js internal, but I think the in operator should not be very slow compare to Array.isArray?
PR updated according to your comments
Sorry, something went wrong.
There was a problem hiding this comment.
Normally we don't expect successful tests to print anything. Can you remove this?
Sorry, something went wrong.
There was a problem hiding this comment.
the tc above also prints, should I remove all log statement in this test-buffer.js?
Sorry, something went wrong.
There was a problem hiding this comment.
That falls outside the scope of this PR :) So I would suggest removing only this.
Sorry, something went wrong.
|
Okay. LGTM with a nit. But I defer it to @trevnorris to call the shot ;-) |
Sorry, something went wrong.
…d code in fromObject.
|
LGTM |
Sorry, something went wrong.
There was a problem hiding this comment.
just an aside, all typed arrays could be more quickly handled in C++, but that doesn't concern this PR. at least now it's centralized and will be easier to make the change. :)
Sorry, something went wrong.
|
One request to add a test, but LGTM. |
Sorry, something went wrong.
…plicated code in fromObject.
Sorry, something went wrong.
|
@jasnell it's this pr Ready To merge ? I'm new here. |
Sorry, something went wrong.
|
@trevnorris ... can you give it one last look over? LGTM |
Sorry, something went wrong.
Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: #4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
|
Landed in c0bfac6 with added commit message body and removed unnecessary else due to return in previous if. Thanks much! |
Sorry, something went wrong.
Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: #4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: #4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
|
is this something we would like to backport? |
Sorry, something went wrong.
|
Not necessary but also is low/no risk. Though it may make tracking future changes easier. |
Sorry, something went wrong.
|
SGTM for LTS |
Sorry, something went wrong.
Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: #4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: #4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add fromArrayLike() to handle logic of copying in values from array-like argument. PR-URL: nodejs#4948 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: #19279 Refs: #19275 (comment) Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19279 Refs: #19275 (comment) Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19279 Refs: #19275 (comment) Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19279 Refs: nodejs#19275 (comment) Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
No description provided.