Closed bakkot closed 5 years ago
Ditto for
for (; false; ) let
x = 0;
for (var x in null) let
{}
for (var x in null) let
x = 0;
for (var x of []) let
{}
for (var x of []) let
x = 0
if (false) let
{}
if (false) let
x = 0
l: let
{}
l: let
x = 0
with ({}) let
{}
with ({}) let
x = 0
while (false) let
{}
while (false) let
x = 0
Addressed by #396.
See this test.
is a perfectly valid program: it is a
for
statement whose body is an ExpressionStatement consisting of anIdentifierExpression
, followed by an empty block.Because there is no lookahead restriction for
let {
for ExpressionStatements it can start parsing as one, and because there is no valid parse beginningfor (; false; ) let \n {
(unlike at the top level of a script), ASI kicks in after thelet
.