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
The problem appears to be with declaring multiple variables with one let statement. If I give each variable its own let statement, it transpiles correctly without warnings:
Note: The Es6SplitVariableDeclarations pass normalizes multivariate declarations with at least one destructuring pattern. I didn't just add let/const declaration normalization to that pass because it doesn't handle declarations outside of a statement block. (e.g. in a for-loop header or label).
Fixesgoogle#2969
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200105402
The following code:
gives the following warning:
(See for yourself on the Closure Compiler web app.)
This is the ES5 output which also appears to be incorrect (
y
from the first block should not be reused):The problem appears to be with declaring multiple variables with one
let
statement. If I give each variable its ownlet
statement, it transpiles correctly without warnings:Output:
(There was some discussion about this already in this StackOverflow thread.)
The text was updated successfully, but these errors were encountered: