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
At least one of the y's should also have been renamed.
(In my "real" code instead of "console.log()" there are local functions that use y and are registered as callbacks. The first function incorrectly uses the value from the second block.)
functiontest(){letf1,f2;{lety=77;f1=()=>console.log(y);}{lety=88;f2=()=>console.log(y);}f1();// Should print 77, actual: 88f2();// Should print 88, does}
TypeScript 1.7.5 does not support the block scope for y here when emitting code for ES5:
Compilation result:
At least one of the y's should also have been renamed.
(In my "real" code instead of "console.log()" there are local functions that use y and are registered as callbacks. The first function incorrectly uses the value from the second block.)
Related to #1690
The text was updated successfully, but these errors were encountered: