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
When dealing the template object, there may be an error in swc,
the result of input code run by node is true, but after transforming by swc, the result is false.
Input code
letfilter=void0;functiontest(quasis, ...expressionValues){const{raw}=quasis;constrawLen=raw.length;expressionValues=expressionValues.map(filter||((x)=>`(${x})`))lets='',i=0;while(true){s+=raw[i];if(i+1===rawLen){returns;}s+=expressionValues[i++];}}{// raw unicode, hexlethex=test`\x22\x21\x224`;console.log(hex==="\\x22\\x21\\x224");}
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
When dealing the template object, there may be an error in swc,
the result of input code run by node is true, but after transforming by swc, the result is false.
Input code
Config
Playground link
https://play.swc.rs/?version=1.2.111&code=H4sIAAAAAAAAA12QTWrDMBCF19IphlCIhI3ThOyMe4Kuu0kKNs4kFqhSqp%2FG4PjuHdnxxgsxw3tvRh%2BjMcBV6YAOKviz6gLvJb9G0wZlDQT0QfzGxiufQ1EU2N8dek%2FWV6Mjejlw1lrjAwyueYy0Yg6Xi0zqJxrSqSk0mlvoyFuvIX8tFT%2FNXSxkzycI0UuoPqAWb0M%2FylqC5Jxpok%2FT220Oiiqxs0enNIIILqIE4mMesun%2Fk%2Fomm6krCAUZ7KGqqhfgHGQOQ3QGEj4bl8k12UllWVo08pEPu13aANGo1l4whw77mYoa4kn3q8%2F94UBvn%2Bqxfp3Gaiy0vYkpRxyb8xSbclNwI0s%2B%2FgNMedErngEAAA%3D%3D&config=H4sIAAAAAAAAA0VOOw6DMAy9i2fWLtygA4ewgkFBSRzZRmqKuHsTNcBkv4%2Ff8wGbOhgPyChK0jYtyfADI5CLqE58NhiqrVILBqVzAENZyZpFX1ULzEpdHSD65JfSkhzHLKT6SJjWcDnPGhR53htxgJVcZzuJnDatqWrind23fzjx%2FDQF%2FJYbJH4nI%2BH8vHl90h1ep15nstP5A1SlDpf7AAAA
Expected behavior
The ori code run by node is true, but after transforming, the result is false.
Version
1.2.111
Additional context
I run swc use cmd as follows
The environment is ubuntu 20.04 amd64.
The text was updated successfully, but these errors were encountered: