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
Using the latest master, this seems to be a pretty serious regression. I noticed my site broke, and tracked it down to an object rest regression.
Basically this code:
letarg={a: true,b: "test",c: 42};letfn=({a, ...rest})=>{console.log(`a is: ${JSON.stringify(a)}`);console.log(`rest is ${JSON.stringify(rest)}`);}fn(arg);
Is generating this emit:
var__rest=(this&&this.__rest)||function(s,e){vart={};for(varpins)if(Object.prototype.hasOwnProperty.call(s,p)&&!e.indexOf(p))t[p]=s[p];returnt;};vararg={a: true,b: "test",c: 42};varfn=function(_a){vara=_a.a,rest=__rest(_a,["a"]);console.log("a is: "+JSON.stringify(a));console.log("rest is "+JSON.stringify(rest));};fn(arg);
Which produces this output
a is: true
rest is {"a":true}
The issue is with !e.indexOf(p), as this only returns "true" for the property which is the first in the list (i.e. the index is 0). It should probably be e.indexOf(p) < 0.
Using the latest master, this seems to be a pretty serious regression. I noticed my site broke, and tracked it down to an object rest regression.
Basically this code:
Is generating this emit:
Which produces this output
The issue is with
!e.indexOf(p)
, as this only returns "true" for the property which is the first in the list (i.e. the index is 0). It should probably bee.indexOf(p) < 0
.CC @mhegazy @rbuckton
The text was updated successfully, but these errors were encountered: