Closed
Description
From looking through the specification, I don't think we are doing the right thing when a let
declaration spans multiple lines.
The following:
let
x
seems to incorrectly compile to
let;
x;
instead of
var x;
I'm not seeing a "[No LineTerminator here]" for let
declarations in the spec. The most relevant restriction on let
that I see is the following:
13.4 Expression Statement
Syntax
ExpressionStatement[Yield] :
[lookahead ∉ {
{
,function
,class
,let [
}] Expression[In,\ ?Yield];
NOTE [...] An ExpressionStatement cannot start with the two token sequence
let [
because that would make it ambiguous with alet
LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern.