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

413 lines
9.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 151,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 41,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 21,
"end": 40,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 21,
"end": 23,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 23,
"end": 40,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 25,
"end": 40,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 25,
"end": 31,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 34,
"end": 40,
"ctxt": 0
},
"kind": "string"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 42,
"end": 68,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 46,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 48,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 50,
"end": 67,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 50,
"end": 56,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsArrayType",
"span": {
"start": 59,
"end": 67,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 59,
"end": 65,
"ctxt": 0
},
"kind": "number"
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 69,
"end": 94,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 73,
"end": 93,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 73,
"end": 75,
"ctxt": 0
},
"value": "p3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 75,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 77,
"end": 93,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 77,
"end": 83,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 86,
"end": 93,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 95,
"end": 151,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 109,
"end": 119,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 109,
"end": 113,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 110,
"end": 112,
"ctxt": 0
},
"value": "p1",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 109,
"end": 119,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 116,
"end": 119,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 124,
"end": 134,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 124,
"end": 128,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": "p2",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 124,
"end": 134,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 131,
"end": 134,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 139,
"end": 149,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 139,
"end": 143,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 140,
"end": 142,
"ctxt": 0
},
"value": "p3",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 139,
"end": 149,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 146,
"end": 149,
"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
}