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

276 lines
6.4 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 110,
"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": "TsInterfaceDeclaration",
"span": {
"start": 49,
"end": 110,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 60,
"end": 63,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 64,
"end": 110,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 70,
"end": 84,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 70,
"end": 73,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 75,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 77,
"end": 83,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 89,
"end": 108,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "CallExpression",
"span": {
"start": 90,
"end": 98,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 93,
"end": 96,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
"computed": true,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 107,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 103,
"end": 107,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
}
],
"interpreter": null
}