swc/crates/swc_ecma_parser/tests/tsc/classStaticBlock13.json

278 lines
7.5 KiB
JSON

{
"type": "Script",
"span": {
"start": 71,
"end": 172,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 71,
"end": 172,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 83,
"end": 99,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "StaticBlock",
"span": {
"start": 103,
"end": 137,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 110,
"end": 137,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 116,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 116,
"end": 133,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 116,
"end": 127,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 116,
"end": 123,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 128,
"end": 132,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 130,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
}
},
{
"type": "ClassMethod",
"span": {
"start": 141,
"end": 170,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 141,
"end": 144,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 141,
"end": 170,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 148,
"end": 170,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 154,
"end": 166,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 161,
"end": 165,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 163,
"end": 165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}