Skip to content

Commit f56e3f7

Browse files
committed
PR feedback and minor fixes due to banning 'using' in switch case/default
1 parent fc3079a commit f56e3f7

File tree

37 files changed

+99
-75
lines changed

37 files changed

+99
-75
lines changed

test/language/statements/using/syntax/block-scope-syntax-using-declarations-mixed-with-without-initializer.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-and-const-declarations-static-semantics-early-errors
66
description: >
77
using declarations mixed: with, without initializer
8+
info: |
9+
Static Semantics : Early Errors
10+
LexicalBinding : BindingIdentifier Initializer?
11+
12+
- It is a Syntax Error if Initializer is not present and IsConstantDeclaration of the LexicalDeclaration containing
13+
this LexicalBinding is true.
14+
15+
Static Semantics : IsConstantDeclaration
16+
UsingDeclaration :
17+
`using` BindingList ;
18+
19+
1. Return true.
20+
821
negative:
922
phase: parse
1023
type: SyntaxError

test/language/statements/using/syntax/block-scope-syntax-using-declarations-mixed-without-with-initializer.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-and-const-declarations-static-semantics-early-errors
66
description: >
77
using declarations mixed: without, with initializer
8+
info: |
9+
Static Semantics : Early Errors
10+
LexicalBinding : BindingIdentifier Initializer?
11+
12+
- It is a Syntax Error if Initializer is not present and IsConstantDeclaration of the LexicalDeclaration containing
13+
this LexicalBinding is true.
14+
15+
Static Semantics : IsConstantDeclaration
16+
UsingDeclaration :
17+
`using` BindingList ;
18+
19+
1. Return true.
20+
821
negative:
922
phase: parse
1023
type: SyntaxError

test/language/statements/using/syntax/block-scope-syntax-using-declarations-without-initializer.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-and-const-declarations-static-semantics-early-errors
66
description: >
77
using declarations without initializer
8+
info: |
9+
Static Semantics : Early Errors
10+
LexicalBinding : BindingIdentifier Initializer?
11+
12+
- It is a Syntax Error if Initializer is not present and IsConstantDeclaration of the LexicalDeclaration containing
13+
this LexicalBinding is true.
14+
15+
Static Semantics : IsConstantDeclaration
16+
UsingDeclaration :
17+
`using` BindingList ;
18+
19+
1. Return true.
20+
821
negative:
922
phase: parse
1023
type: SyntaxError

test/language/statements/using/syntax/using-allowed-at-top-level-of-module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-const-using-and-await-using-declarations-static-semantics-early-errors
66
description: >
77
using declarations allowed at the top level of a module
88
info: |
99
UsingDeclaration : using BindingList ;
1010
1111
- It is a Syntax Error if the goal symbol is Script and UsingDeclaration is not contained, either directly or
12-
indirectly, within a Block, CaseBlock, ForStatement, ForInOfStatement, FunctionBody, GeneratorBody,
12+
indirectly, within a Block, ForStatement, ForInOfStatement, FunctionBody, GeneratorBody,
1313
AsyncGeneratorBody, AsyncFunctionBody, ClassStaticBlockBody, or ClassBody.
1414
1515
flags: [module]

test/language/statements/using/syntax/using-allows-bindingidentifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-const-using-and-await-using-declarations
66
description: >
77
'using' allows BindingIdentifier in lexical bindings
88
features: [explicit-resource-management]

test/language/statements/using/syntax/using-allows-multiple-bindings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-const-using-and-await-using-declarations
66
description: >
77
'using' allows multiple lexical bindings
88
features: [explicit-resource-management]

test/language/statements/using/syntax/using-declaring-let-split-across-two-lines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-const-using-and-await-using-declarations
66
description: >
77
using: |using let| split across two lines is treated as two statements.
88
info: |

test/language/statements/using/syntax/using-for-statement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2011 the V8 project authors. All rights reserved.
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
22
// This code is governed by the BSD license found in the LICENSE file.
33
/*---
44
esid: sec-for-statement

test/language/statements/using/syntax/using-for-using-of-of.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2011 the V8 project authors. All rights reserved.
1+
// Copyright (C) 2023 Ron Buckton. All rights reserved.
22
// This code is governed by the BSD license found in the LICENSE file.
33
/*---
44
esid: sec-for-in-and-for-of-statements

test/language/statements/using/syntax/using-invalid-arraybindingpattern-after-bindingidentifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: pending
5+
esid: sec-let-const-using-and-await-using-declarations
66
description: >
77
'using' does not allow ArrayBindingPattern in lexical bindings, even after a valid lexical binding
88
negative:

0 commit comments

Comments
 (0)