Using the spread op in an ES6 function:
compiles to something like:
function foo(args){
args = [].slice.call(arguments, 0);
}
This leaks and prevents compiler optimization (There's about a 20x slowdown here). As much as I dislike code bloating, I believe it should compile to:
function foo(args){
args=[];
for(var i=0, l=arguments.length; i<l; i++){ args.push(arguments[i])); }
}
or similiar (obviously slightly different if the spread isn't the first argument).
Using the spread op in an ES6 function:
compiles to something like:
This leaks and prevents compiler optimization (There's about a 20x slowdown here). As much as I dislike code bloating, I believe it should compile to:
or similiar (obviously slightly different if the spread isn't the first argument).