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.
Currently, it's hardcoded in the compiler to use
$slice.call(arguments, 0)
. This PR just does the usual arguments->array copy via iteration while also making the JS code less terrible than I've been doing by declaring that target variable with the rest of the locals. :-)Results from
rake bench
(from left to right: master, this PR, MRI):As a bonus, I renamed the index variable for splat args and added a local variable for it. I hadn't intended to commit it but I apparently wasn't paying attention. :-) The only reason I changed it at all was because I originally used
arg_index
in both places, butStruct.new
uses both splat args and barewordsuper
sovar arg_index
in two places within the same scope caused JSHint to barf.