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

311 lines
7.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 120,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 29,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 17,
"end": 48,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 35,
"end": 48,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 37,
"end": 46,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 44,
"end": 46,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 29,
"end": 32,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 49,
"end": 120,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 66,
"end": 97,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 66,
"end": 97,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 72,
"end": 97,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 82,
"end": 91,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 102,
"end": 118,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 102,
"end": 112,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 103,
"end": 111,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 106,
"end": 109,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 102,
"end": 118,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 115,
"end": 118,
"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": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 56,
"end": 59,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}