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

378 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 37,
"end": 202,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 37,
"end": 46,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
},
"value": "getX",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 47,
"end": 202,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 59,
"end": 65,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 59,
"end": 61,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 68,
"end": 113,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 68,
"end": 79,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 80,
"end": 89,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 80,
"end": 89,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 81,
"end": 89,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 83,
"end": 89,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 91,
"end": 113,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 97,
"end": 109,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 97,
"end": 108,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 97,
"end": 104,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 97,
"end": 101,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "StaticBlock",
"span": {
"start": 117,
"end": 200,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 124,
"end": 200,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 170,
"end": 196,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 170,
"end": 195,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 170,
"end": 174,
"ctxt": 0
},
"value": "getX",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 177,
"end": 195,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 178,
"end": 184,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 189,
"end": 195,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 189,
"end": 192,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 193,
"end": 195,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
}
]
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}