@@ -17794,6 +17794,9 @@ <h1>Rules of Automatic Semicolon Insertion</h1>
17794
17794
LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++`
17795
17795
LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--`
17796
17796
17797
+ UsingDeclaration[In, Yield, Await] :
17798
+ `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;`
17799
+
17797
17800
ContinueStatement[Yield, Await] :
17798
17801
`continue` `;`
17799
17802
`continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;`
@@ -17849,6 +17852,9 @@ <h1>Rules of Automatic Semicolon Insertion</h1>
17849
17852
<li>
17850
17853
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.
17851
17854
</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>
17852
17858
<li>
17853
17859
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.
17854
17860
</li>
@@ -17867,6 +17873,9 @@ <h1>Rules of Automatic Semicolon Insertion</h1>
17867
17873
<li>
17868
17874
A postfix `++` or `--` operator should be on the same line as its operand.
17869
17875
</li>
17876
+ <li>
17877
+ A |BindingList| in a `using` declaration should start on the same line as the `using` token.
17878
+ </li>
17870
17879
<li>
17871
17880
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.
17872
17881
</li>
@@ -21278,23 +21287,23 @@ <h1>Let, Const, and Using Declarations</h1>
21278
21287
<h2>Syntax</h2>
21279
21288
<emu-grammar type="definition">
21280
21289
LexicalDeclaration[In, Yield, Await] :
21281
- LetOrConst BindingList[?In, ?Yield, ?Await] `;`
21290
+ LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern ] `;`
21282
21291
UsingDeclaration[?In, ?Yield, ?Await]
21283
21292
21284
21293
LetOrConst :
21285
21294
`let`
21286
21295
`const`
21287
21296
21288
21297
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 ] `;`
21290
21299
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 ]
21294
21303
21295
- LexicalBinding[In, Yield, Await] :
21304
+ LexicalBinding[In, Yield, Await, Pattern ] :
21296
21305
BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]?
21297
- BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]
21306
+ [+Pattern] BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]
21298
21307
</emu-grammar>
21299
21308
21300
21309
<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>
21329
21338
It is a Syntax Error if |Initializer| is not present and IsConstantDeclaration of the |LexicalDeclaration| containing this |LexicalBinding| is *true*.
21330
21339
</li>
21331
21340
</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>
21338
21341
</emu-clause>
21339
21342
21340
21343
<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>
21987
21990
<emu-grammar type="definition">
21988
21991
ForInOfStatement[Yield, Await, Return] :
21989
21992
`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]
21991
21994
`for` `(` ForDeclaration[?Yield, ?Await, ~Using] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21992
21995
`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]
21994
21997
`for` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21995
21998
[+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]
21997
22000
[+Await] `for` `await` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]
21998
22001
21999
22002
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 ]
22002
22005
22003
- ForBinding[Yield, Await] :
22006
+ ForBinding[Yield, Await, Pattern ] :
22004
22007
BindingIdentifier[?Yield, ?Await]
22005
- BindingPattern[?Yield, ?Await]
22008
+ [+Pattern] BindingPattern[?Yield, ?Await]
22006
22009
</emu-grammar>
22007
22010
<emu-note>
22008
22011
<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>
22065
22068
It is a Syntax Error if the BoundNames of |ForDeclaration| contains any duplicate entries.
22066
22069
</li>
22067
22070
</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>
22074
22071
</emu-clause>
22075
22072
22076
22073
<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