[babel-parser] add tests for static blocks with line breaks (#13734)
This commit is contained in:
parent
62e42a3f60
commit
c25ec3e069
@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
static
|
||||
{
|
||||
something();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ClassDeclaration",
|
||||
"start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"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":47,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}},
|
||||
"body": [
|
||||
{
|
||||
"type": "StaticBlock",
|
||||
"start":14,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}},
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start":29,"end":41,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":16}},
|
||||
"expression": {
|
||||
"type": "CallExpression",
|
||||
"start":29,"end":40,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}},
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start":29,"end":38,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13},"identifierName":"something"},
|
||||
"name": "something"
|
||||
},
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user