Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: add class static blocks tests
acorn has been upgraded in ee1d3ec, this commit simply added some tests. The tests were copied from test262, refs: tc39/test262@afe217b
- Loading branch information
1 parent
54ed0c0
commit 3fad0e2
Showing
146 changed files
with
56,041 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...ion/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
"index": 411, | ||
"lineNumber": 16, | ||
"column": 6, | ||
"message": "Cannot use await in class static initialization block" | ||
}; |
18 changes: 18 additions & 0 deletions
18
...ersion/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (C) 2021 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-class-definitions-static-semantics-early-errors | ||
description: The `await` keyword is disallowed in the BindingIdentifier position | ||
features: [class-static-block] | ||
negative: | ||
phase: parse | ||
type: SyntaxError | ||
---*/ | ||
|
||
$DONOTEVALUATE(); | ||
|
||
class C { | ||
static { | ||
(await => 0); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...n/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
"index": 418, | ||
"lineNumber": 16, | ||
"column": 11, | ||
"message": "Cannot use await in class static initialization block" | ||
}; |
18 changes: 18 additions & 0 deletions
18
...sion/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (C) 2021 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-class-definitions-static-semantics-early-errors | ||
description: The `await` keyword is disallowed in the IdentifierReference position | ||
features: [class-static-block] | ||
negative: | ||
phase: parse | ||
type: SyntaxError | ||
---*/ | ||
|
||
$DONOTEVALUATE(); | ||
|
||
class C { | ||
static { | ||
((x = await) => 0); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
"index": 562, | ||
"lineNumber": 21, | ||
"column": 12, | ||
"message": "Cannot use await in class static initialization block" | ||
}; |
23 changes: 23 additions & 0 deletions
23
...es/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (C) 2021 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-class-definitions-static-semantics-early-errors | ||
description: The `await` keyword is disallowed as a BindingIdentifier | ||
info: | | ||
ClassStaticBlockBody : ClassStaticBlockStatementList | ||
[...] | ||
- It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true. | ||
features: [class-static-block] | ||
negative: | ||
phase: parse | ||
type: SyntaxError | ||
---*/ | ||
|
||
$DONOTEVALUATE(); | ||
|
||
class C { | ||
static { | ||
(class await {}); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ion/13/class-static-blocks/expressions-class-static-init-await-reference.module-result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
"index": 499, | ||
"lineNumber": 14, | ||
"column": 5, | ||
"message": "Cannot use keyword 'await' outside an async function" | ||
}; |
Oops, something went wrong.