Huáng Jùnliàng 3ccca88178 Parse class static block (#12079)
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 21:16:24 +02:00

168 lines
7.4 KiB
JSON

{
"type": "File",
"start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":17,"column":1}},
"program": {
"type": "Program",
"start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":17,"column":1}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":17,"column":1}},
"id": {
"type": "Identifier",
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"},
"name": "C"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start":8,"end":210,"loc":{"start":{"line":1,"column":8},"end":{"line":17,"column":1}},
"body": [
{
"type": "ClassMethod",
"start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}},
"static": true,
"key": {
"type": "Identifier",
"start":19,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"},
"name": "foo"
},
"computed": false,
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":25,"end":27,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}},
"body": [],
"directives": []
}
},
{
"type": "StaticBlock",
"start":30,"end":208,"loc":{"start":{"line":3,"column":2},"end":{"line":16,"column":3}},
"body": [
{
"type": "WhileStatement",
"start":43,"end":145,"loc":{"start":{"line":4,"column":4},"end":{"line":10,"column":5}},
"test": {
"type": "MemberExpression",
"start":50,"end":58,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":19}},
"object": {
"type": "ThisExpression",
"start":50,"end":54,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}}
},
"computed": false,
"property": {
"type": "Identifier",
"start":55,"end":58,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":19},"identifierName":"foo"},
"name": "foo"
}
},
"body": {
"type": "BlockStatement",
"start":60,"end":145,"loc":{"start":{"line":4,"column":21},"end":{"line":10,"column":5}},
"body": [
{
"type": "IfStatement",
"start":68,"end":139,"loc":{"start":{"line":5,"column":6},"end":{"line":9,"column":7}},
"test": {
"type": "MemberExpression",
"start":72,"end":80,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":18}},
"object": {
"type": "ThisExpression",
"start":72,"end":76,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":14}}
},
"computed": false,
"property": {
"type": "Identifier",
"start":77,"end":80,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":18},"identifierName":"foo"},
"name": "foo"
}
},
"consequent": {
"type": "BlockStatement",
"start":82,"end":106,"loc":{"start":{"line":5,"column":20},"end":{"line":7,"column":7}},
"body": [
{
"type": "BreakStatement",
"start":92,"end":98,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":14}},
"label": null
}
],
"directives": []
},
"alternate": {
"type": "BlockStatement",
"start":112,"end":139,"loc":{"start":{"line":7,"column":13},"end":{"line":9,"column":7}},
"body": [
{
"type": "ContinueStatement",
"start":122,"end":131,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":17}},
"label": null
}
],
"directives": []
}
}
],
"directives": []
}
},
{
"type": "ClassDeclaration",
"start":150,"end":204,"loc":{"start":{"line":11,"column":4},"end":{"line":15,"column":5}},
"id": {
"type": "Identifier",
"start":156,"end":158,"loc":{"start":{"line":11,"column":10},"end":{"line":11,"column":12},"identifierName":"C2"},
"name": "C2"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start":159,"end":204,"loc":{"start":{"line":11,"column":13},"end":{"line":15,"column":5}},
"body": [
{
"type": "ClassMethod",
"start":167,"end":198,"loc":{"start":{"line":12,"column":6},"end":{"line":14,"column":7}},
"static": false,
"key": {
"type": "Identifier",
"start":167,"end":170,"loc":{"start":{"line":12,"column":6},"end":{"line":12,"column":9},"identifierName":"bar"},
"name": "bar"
},
"computed": false,
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":173,"end":198,"loc":{"start":{"line":12,"column":12},"end":{"line":14,"column":7}},
"body": [
{
"type": "ReturnStatement",
"start":183,"end":190,"loc":{"start":{"line":13,"column":8},"end":{"line":13,"column":15}},
"argument": null
}
],
"directives": []
}
}
]
}
}
]
}
]
}
}
],
"directives": []
}
}