Skip to content

Commit

Permalink
Chore: add class static blocks tests (refs eslint/eslint#15016)
Browse files Browse the repository at this point in the history
acorn has been upgraded in ee1d3ec, this commit
simiply added some tests. The tests were copied from test262, refs: tc39/test262@afe217b
  • Loading branch information
aladdin-add committed Sep 16, 2021
1 parent 593148d commit 657fd74
Show file tree
Hide file tree
Showing 169 changed files with 6,321 additions and 6,107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 170,
"lineNumber": 2,
"column": 3,
"message": "The keyword 'static' is reserved"
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
"index": 26,
"lineNumber": 3,
"column": 6,
"message": "Cannot use await in class static initialization block"
"index": 177,
"lineNumber": 2,
"column": 10,
"message": "Unexpected token {"
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class C {
// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/arrow-function/static-init-await-binding.jsclass C {
static {
(await => 0);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 172,
"lineNumber": 2,
"column": 3,
"message": "The keyword 'static' is reserved"
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
"index": 31,
"lineNumber": 3,
"column": 11,
"message": "Cannot use await in class static initialization block"
"index": 179,
"lineNumber": 2,
"column": 10,
"message": "Unexpected token {"
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class C {
// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/arrow-function/static-init-await-reference.jsclass C {
static {
((x = await) => 0);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 161,
"lineNumber": 2,
"column": 3,
"message": "The keyword 'static' is reserved"
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
"index": 32,
"lineNumber": 3,
"column": 12,
"message": "Cannot use await in class static initialization block"
"index": 168,
"lineNumber": 2,
"column": 10,
"message": "Unexpected token {"
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class C {
// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/class/static-init-await-binding.jsclass C {
static {
(class await {});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
"index": 6,
"index": 157,
"lineNumber": 3,
"column": 5,
"message": "Cannot use keyword 'await' outside an async function"
Expand Down
Loading

0 comments on commit 657fd74

Please sign in to comment.