@@ -17794,6 +17794,9 @@ <h1>Rules of Automatic Semicolon Insertion</h1>
1779417794 LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++`
1779517795 LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--`
1779617796
17797+ UsingDeclaration[In, Yield, Await] :
17798+ `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;`
17799+
1779717800 ContinueStatement[Yield, Await] :
1779817801 `continue` `;`
1779917802 `continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;`
@@ -17849,6 +17852,9 @@ <h1>Rules of Automatic Semicolon Insertion</h1>
1784917852 <li>
1785017853 When a `++` or `--` token is encountered where the parser would treat it as a postfix operator, and at least one |LineTerminator| occurred between the preceding token and the `++` or `--` token, then a semicolon is automatically inserted before the `++` or `--` token.
1785117854 </li>
17855+ <li>
17856+ When a `using` token is encountered and a |LineTerminator| is encountered before an |IdentifierName| token, a semicolon is automatically inserted after the `using` token.
17857+ </li>
1785217858 <li>
1785317859 When a `continue`, `break`, `return`, `throw`, or `yield` token is encountered and a |LineTerminator| is encountered before the next token, a semicolon is automatically inserted after the `continue`, `break`, `return`, `throw`, or `yield` token.
1785417860 </li>
@@ -17867,6 +17873,9 @@ <h1>Rules of Automatic Semicolon Insertion</h1>
1786717873 <li>
1786817874 A postfix `++` or `--` operator should be on the same line as its operand.
1786917875 </li>
17876+ <li>
17877+ A |BindingList| in a `using` declaration should start on the same line as the `using` token.
17878+ </li>
1787017879 <li>
1787117880 An |Expression| in a `return` or `throw` statement or an |AssignmentExpression| in a `yield` expression should start on the same line as the `return`, `throw`, or `yield` token.
1787217881 </li>
@@ -21278,23 +21287,23 @@ <h1>Let, Const, and Using Declarations</h1>
2127821287 <h2>Syntax</h2>
2127921288 <emu-grammar type="definition">
2128021289 LexicalDeclaration[In, Yield, Await] :
21281- LetOrConst BindingList[?In, ?Yield, ?Await] `;`
21290+ LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern ] `;`
2128221291 UsingDeclaration[?In, ?Yield, ?Await]
2128321292
2128421293 LetOrConst :
2128521294 `let`
2128621295 `const`
2128721296
2128821297 UsingDeclaration[In, Yield, Await] :
21289- `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await] `;`
21298+ `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern ] `;`
2129021299
21291- BindingList[In, Yield, Await] :
21292- LexicalBinding[?In, ?Yield, ?Await]
21293- BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await]
21300+ BindingList[In, Yield, Await, Pattern ] :
21301+ LexicalBinding[?In, ?Yield, ?Await, ?Pattern ]
21302+ BindingList[?In, ?Yield, ?Await, ?Pattern ] `,` LexicalBinding[?In, ?Yield, ?Await, ?Pattern ]
2129421303
21295- LexicalBinding[In, Yield, Await] :
21304+ LexicalBinding[In, Yield, Await, Pattern ] :
2129621305 BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]?
21297- BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]
21306+ [+Pattern] BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]
2129821307 </emu-grammar>
2129921308
2130021309 <emu-clause id="sec-let-const-and-using-declarations-static-semantics-early-errors" oldids="sec-let-and-const-declarations-static-semantics-early-errors">
@@ -21329,12 +21338,6 @@ <h1>Static Semantics: Early Errors</h1>
2132921338 It is a Syntax Error if |Initializer| is not present and IsConstantDeclaration of the |LexicalDeclaration| containing this |LexicalBinding| is *true*.
2133021339 </li>
2133121340 </ul>
21332- <emu-grammar>LexicalBinding : BindingPattern Initializer</emu-grammar>
21333- <ul>
21334- <li>
21335- It is a Syntax Error if IsUsingDeclaration of the |LexicalDeclaration| containing this |LexicalBinding| is *true*.
21336- </li>
21337- </ul>
2133821341 </emu-clause>
2133921342
2134021343 <emu-clause id="sec-let-const-and-using-declarations-runtime-semantics-evaluation" oldids="sec-let-and-const-declarations-runtime-semantics-evaluation" type="sdo">
@@ -21987,22 +21990,22 @@ <h2>Syntax</h2>
2198721990 <emu-grammar type="definition">
2198821991 ForInOfStatement[Yield, Await, Return] :
2198921992 `for` `(` [lookahead != `let` `[`] LeftHandSideExpression[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21990- `for` `(` `var` ForBinding[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21993+ `for` `(` `var` ForBinding[?Yield, ?Await, +Pattern ] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
2199121994 `for` `(` ForDeclaration[?Yield, ?Await, ~Using] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
2199221995 `for` `(` [lookahead ∉ { `let`, `async` `of` }] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21993- `for` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21996+ `for` `(` `var` ForBinding[?Yield, ?Await, +Pattern ] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
2199421997 `for` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
2199521998 [+Await] `for` `await` `(` [lookahead != `let`] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21996- [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21999+ [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await, +Pattern ] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
2199722000 [+Await] `for` `await` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
2199822001
2199922002 ForDeclaration[Yield, Await, Using] :
22000- LetOrConst ForBinding[?Yield, ?Await]
22001- [+Using] `using` [no LineTerminator here] [lookahead != `await`] ForBinding[?Yield, ?Await]
22003+ LetOrConst ForBinding[?Yield, ?Await, +Pattern ]
22004+ [+Using] `using` [no LineTerminator here] [lookahead != `await`] ForBinding[?Yield, ?Await, ~Pattern ]
2200222005
22003- ForBinding[Yield, Await] :
22006+ ForBinding[Yield, Await, Pattern ] :
2200422007 BindingIdentifier[?Yield, ?Await]
22005- BindingPattern[?Yield, ?Await]
22008+ [+Pattern] BindingPattern[?Yield, ?Await]
2200622009 </emu-grammar>
2200722010 <emu-note>
2200822011 <p>This section is extended by Annex <emu-xref href="#sec-initializers-in-forin-statement-heads"></emu-xref>.</p>
@@ -22065,12 +22068,6 @@ <h1>Static Semantics: Early Errors</h1>
2206522068 It is a Syntax Error if the BoundNames of |ForDeclaration| contains any duplicate entries.
2206622069 </li>
2206722070 </ul>
22068- <emu-grammar>ForBinding : BindingPattern</emu-grammar>
22069- <ul>
22070- <li>
22071- It is a Syntax Error if this |ForBinding| is contained within a |ForDeclaration| and IsUsingDeclaration of that |ForDeclaration| is *true*.
22072- </li>
22073- </ul>
2207422071 </emu-clause>
2207522072
2207622073 <emu-clause id="sec-static-semantics-isdestructuring" oldids="sec-static-semantics-static-semantics-isdestructuring,sec-for-in-and-for-of-statements-static-semantics-isdestructuring" type="sdo">
0 commit comments