Parse class static block (#12079)
Co-authored-by: Brian Ng <bng412@gmail.com>
This commit is contained in:
committed by
Nicolò Ribaudo
parent
6830c90ac9
commit
3ccca88178
@@ -0,0 +1,8 @@
|
||||
while (0) {
|
||||
class C {
|
||||
static foo() {}
|
||||
static {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
85
packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json
vendored
Normal file
85
packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}},
|
||||
"errors": [
|
||||
"SyntaxError: Unsyntactic continue (5:6)"
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "WhileStatement",
|
||||
"start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}},
|
||||
"test": {
|
||||
"type": "NumericLiteral",
|
||||
"start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8}},
|
||||
"extra": {
|
||||
"rawValue": 0,
|
||||
"raw": "0"
|
||||
},
|
||||
"value": 0
|
||||
},
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start":10,"end":84,"loc":{"start":{"line":1,"column":10},"end":{"line":8,"column":1}},
|
||||
"body": [
|
||||
{
|
||||
"type": "ClassDeclaration",
|
||||
"start":14,"end":82,"loc":{"start":{"line":2,"column":2},"end":{"line":7,"column":3}},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start":20,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"C"},
|
||||
"name": "C"
|
||||
},
|
||||
"superClass": null,
|
||||
"body": {
|
||||
"type": "ClassBody",
|
||||
"start":22,"end":82,"loc":{"start":{"line":2,"column":10},"end":{"line":7,"column":3}},
|
||||
"body": [
|
||||
{
|
||||
"type": "ClassMethod",
|
||||
"start":28,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":19}},
|
||||
"static": true,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start":35,"end":38,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14},"identifierName":"foo"},
|
||||
"name": "foo"
|
||||
},
|
||||
"computed": false,
|
||||
"kind": "method",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start":41,"end":43,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":19}},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "StaticBlock",
|
||||
"start":48,"end":78,"loc":{"start":{"line":4,"column":4},"end":{"line":6,"column":5}},
|
||||
"body": [
|
||||
{
|
||||
"type": "ContinueStatement",
|
||||
"start":63,"end":72,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":15}},
|
||||
"label": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user