-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Describe the bug
SWC does not properly handle scoping on for loop function members.
Input code
for (let i = 0, getI = () => i; i < 3; i++) {
console.log(getI());
}Config
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false
},
"target": "es5",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}Playground link
Expected behavior
Should log
0
0
0
Actual behavior
Logs
0
1
2
Version
1.3.16
Additional context
silverprize