You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell b is always an instance of Array when destructured, even if x is an Array subclass. If so it won't need a separate reference to the splice method. I think this just may be some extra clean up that fell through the cracks in #4884
Possible Solution
Context
Environment
CoffeeScript version: 2.7.0
The text was updated successfully, but these errors were encountered:
I think splice = [].splice might be slightly faster than b.splice, because there’s just one reference already resolved for every time that splice is used, rather than b.splice causing a prototype chain lookup every time.
for me the ref variant of your benchmark is ~4% slower in Firefox
edit: i moved the other decls into the setup code and it doesn't make a difference
most runs ref is slower but sometimes it wins by 2% or so
so i'd say it doesn't matter
Choose one: is this a bug report or feature request?
Input Code
https://coffeescript.org/#try:%5Ba%2C%20...b%2C%20c%5D%20%3D%20x
Expected Behavior
Current Behavior
As far as I can tell
b
is always an instance ofArray
when destructured, even ifx
is anArray
subclass. If so it won't need a separate reference to thesplice
method. I think this just may be some extra clean up that fell through the cracks in #4884Possible Solution
Context
Environment
The text was updated successfully, but these errors were encountered: