Skip to content

LHS expression of a for-of loop cannot start with let #1009

@mdjermanovic

Description

@mdjermanovic

I think these should be invalid:

for (let.foo of bar);
for (let().bar of baz);
for (let``.bar of baz);

ForInOfStatement:

for ( [lookahead ≠ let] LeftHandSideExpression[?Yield, ?Await] of AssignmentExpression[+In, ?Yield, ?Await] ) Statement[?Yield, ?Await, ?Return]

Expressions starting with ( are ok, like for ((let).foo of bar);, for ((let.foo) of bar);, for ((let) of bar);, and of course declarations like for (let foo of bar);, for (let [foo] of bar);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions