diff options
Diffstat (limited to 'lib/parse.js')
-rw-r--r-- | lib/parse.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/parse.js b/lib/parse.js index b926f188..ef0fc49a 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1067,6 +1067,9 @@ function parse($TEXT, options) { if (init.definitions.length > 1) { token_error(init.start, "Only one variable declaration allowed in for..in/of loop"); } + if (ctor !== AST_ForIn && init.definitions[0].value) { + token_error(init.definitions[0].value.start, "No initializers allowed in for..of loop"); + } } else if (!(is_assignable(init) || (init = to_destructured(init)) instanceof AST_Destructured)) { token_error(init.start, "Invalid left-hand side in for..in/of loop"); } |