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

430 lines
10 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 17,
"end": 183,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 23,
"end": 26,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 17,
"end": 32,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 39,
"end": 43,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"declare": false,
"span": {
"start": 33,
"end": 52,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 54,
"end": 183,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 69,
"end": 78,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 70,
"end": 78,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 91,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 81,
"end": 91,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 84,
"end": 91,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 87,
"end": 91,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 87,
"end": 91,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": null
}
}
}
},
"readonly": false,
"static": false,
"span": {
"start": 68,
"end": 92,
"ctxt": 0
}
},
{
"type": "ClassMethod",
"span": {
"start": 125,
"end": 150,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 126,
"end": 128,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 125,
"end": 150,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 132,
"end": 150,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 134,
"end": 148,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 141,
"end": 148,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 145,
"end": 148,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 155,
"end": 181,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 155,
"end": 159,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 156,
"end": 158,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 155,
"end": 181,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 162,
"end": 181,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 164,
"end": 179,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 171,
"end": 179,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 175,
"end": 179,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
},
"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
}