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

1183 lines
30 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 395,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 30,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 29,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 21,
"end": 29,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 23,
"end": 29,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 31,
"end": 45,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 35,
"end": 44,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 44,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 38,
"end": 44,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 46,
"end": 57,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 50,
"end": 56,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 51,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 58,
"end": 395,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 72,
"end": 94,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 76,
"end": 79,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 72,
"end": 94,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 82,
"end": 94,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 84,
"end": 93,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 99,
"end": 113,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 99,
"end": 113,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 110,
"end": 113,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 118,
"end": 152,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 118,
"end": 152,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 139,
"end": 152,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 141,
"end": 150,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 157,
"end": 175,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 161,
"end": 168,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "n",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 157,
"end": 175,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 175,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 180,
"end": 204,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 185,
"end": 187,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 180,
"end": 204,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 191,
"end": 204,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 193,
"end": 202,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 209,
"end": 231,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 220,
"end": 224,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 221,
"end": 223,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 209,
"end": 231,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 228,
"end": 231,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 236,
"end": 259,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 240,
"end": 243,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": 0.0
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 236,
"end": 259,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 246,
"end": 259,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 248,
"end": 257,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 255,
"end": 256,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 264,
"end": 278,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 268,
"end": 271,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 264,
"end": 278,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 275,
"end": 278,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 283,
"end": 321,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 294,
"end": 305,
"ctxt": 0
},
"expression": {
"type": "TsTypeAssertion",
"span": {
"start": 295,
"end": 304,
"ctxt": 0
},
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 300,
"end": 304,
"ctxt": 0
},
"value": true
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 296,
"end": 299,
"ctxt": 0
},
"kind": "any"
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 283,
"end": 321,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 308,
"end": 321,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 310,
"end": 319,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 326,
"end": 350,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 330,
"end": 343,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 331,
"end": 342,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 332,
"end": 341,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 332,
"end": 341,
"ctxt": 0
},
"value": "hello bye",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 332,
"end": 341,
"ctxt": 0
},
"value": "hello bye",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 326,
"end": 350,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 347,
"end": 350,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 355,
"end": 393,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 359,
"end": 377,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 360,
"end": 376,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 369,
"end": 370,
"ctxt": 0
},
"value": "a",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 361,
"end": 367,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 361,
"end": 367,
"ctxt": 0
},
"value": "hello ",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 361,
"end": 367,
"ctxt": 0
},
"value": "hello ",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 371,
"end": 375,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 371,
"end": 375,
"ctxt": 0
},
"value": " bye",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 371,
"end": 375,
"ctxt": 0
},
"value": " bye",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 355,
"end": 393,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 380,
"end": 393,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 382,
"end": 391,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}