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

340 lines
9.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 159,
"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": 159,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 66,
"end": 157,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 66,
"end": 157,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 72,
"end": 157,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 82,
"end": 133,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 86,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 86,
"end": 89,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 92,
"end": 132,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Computed",
"span": {
"start": 106,
"end": 116,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 107,
"end": 115,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 107,
"end": 110,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 110,
"end": 113,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"params": [],
"decorators": [],
"span": {
"start": 106,
"end": 122,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
},
"definite": false
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 142,
"end": 151,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 149,
"end": 150,
"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
}
],
"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
}