Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Aug 25, 2021
1 parent 5ea75b9 commit 828b241
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 0 deletions.
@@ -0,0 +1,3 @@
class Foo {
static abstract {}
}
@@ -0,0 +1,12 @@
{
"plugins": [
[
"classStaticBlock"
],
[
"typescript"
]
],
"sourceType": "module",
"throws": "Unexpected token (2:18)"
}
@@ -0,0 +1,3 @@
class Foo {
abstract static {}
}
@@ -0,0 +1,38 @@
{
"type": "File",
"start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"errors": [
"SyntaxError: Static class blocks cannot have any modifier. (2:20)"
],
"program": {
"type": "Program",
"start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"id": {
"type": "Identifier",
"start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"},
"name": "Foo"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}},
"body": [
{
"type": "StaticBlock",
"start":14,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}},
"abstract": true,
"body": []
}
]
}
}
],
"directives": []
}
}
@@ -0,0 +1,3 @@
class Foo {
static override {}
}
@@ -0,0 +1,12 @@
{
"plugins": [
[
"classStaticBlock"
],
[
"typescript"
]
],
"sourceType": "module",
"throws": "Unexpected token (2:18)"
}
@@ -0,0 +1,3 @@
class Foo {
static declare {}
}
@@ -0,0 +1,12 @@
{
"plugins": [
[
"classStaticBlock"
],
[
"typescript"
]
],
"sourceType": "module",
"throws": "Unexpected token (2:17)"
}
@@ -0,0 +1,3 @@
class Foo {
static readonly {}
}
@@ -0,0 +1,12 @@
{
"plugins": [
[
"classStaticBlock"
],
[
"typescript"
]
],
"sourceType": "module",
"throws": "Unexpected token (2:18)"
}

0 comments on commit 828b241

Please sign in to comment.