swc/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesWithStaticProperty.json
2022-03-22 07:54:08 +00:00

391 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 198,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 198,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 30,
"end": 53,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 37,
"end": 47,
"ctxt": 0
},
"value": "staticProp",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 50,
"end": 52,
"ctxt": 0
},
"value": 10.0
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 58,
"end": 110,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 62,
"end": 76,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 63,
"end": 75,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 65,
"end": 75,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 58,
"end": 110,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 110,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 89,
"end": 104,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 96,
"end": 103,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 115,
"end": 171,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 119,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 120,
"end": 132,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 122,
"end": 132,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 134,
"end": 143,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 134,
"end": 143,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 143,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 137,
"end": 143,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 115,
"end": 171,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 145,
"end": 171,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 155,
"end": 165,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 159,
"end": 164,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "x",
"optional": false
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 176,
"end": 196,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 176,
"end": 190,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 177,
"end": 189,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 179,
"end": 189,
"ctxt": 0
},
"value": "staticProp",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 176,
"end": 196,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 193,
"end": 196,
"ctxt": 0
},
"stmts": []
},
"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
}