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

1108 lines
28 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 396,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 31,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 21,
"end": 30,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 22,
"end": 30,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 24,
"end": 30,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 32,
"end": 46,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 36,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 36,
"end": 37,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 37,
"end": 45,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 47,
"end": 58,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 51,
"end": 57,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 57,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 59,
"end": 396,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 73,
"end": 95,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 73,
"end": 95,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 83,
"end": 95,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 85,
"end": 94,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"value": 0.0,
"raw": "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": 100,
"end": 114,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 100,
"end": 114,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 111,
"end": 114,
"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": 119,
"end": 153,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 130,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 131,
"end": 136,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 119,
"end": 153,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 140,
"end": 153,
"ctxt": 0
},
"stmts": [
{
"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": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 158,
"end": 176,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 162,
"end": 169,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 163,
"end": 168,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"value": "n",
"optional": false
}
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 158,
"end": 176,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 173,
"end": 176,
"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": 181,
"end": 205,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 186,
"end": 188,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 181,
"end": 205,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 192,
"end": 205,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 194,
"end": 203,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": 0.0,
"raw": "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": 210,
"end": 232,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 221,
"end": 225,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 222,
"end": 224,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 210,
"end": 232,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 229,
"end": 232,
"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": 237,
"end": 260,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 241,
"end": 244,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 237,
"end": 260,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 247,
"end": 260,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 249,
"end": 258,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": 0.0,
"raw": "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": 265,
"end": 279,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 269,
"end": 272,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 270,
"end": 271,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 265,
"end": 279,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 276,
"end": 279,
"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": 284,
"end": 322,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 295,
"end": 306,
"ctxt": 0
},
"expression": {
"type": "TsTypeAssertion",
"span": {
"start": 296,
"end": 305,
"ctxt": 0
},
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 301,
"end": 305,
"ctxt": 0
},
"value": true
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 297,
"end": 300,
"ctxt": 0
},
"kind": "any"
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 284,
"end": 322,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 309,
"end": 322,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 311,
"end": 320,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"value": 0.0,
"raw": "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": 327,
"end": 351,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 331,
"end": 344,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 332,
"end": 343,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 333,
"end": 342,
"ctxt": 0
},
"tail": true,
"cooked": "hello bye",
"raw": "hello bye"
}
]
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 327,
"end": 351,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 348,
"end": 351,
"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": 356,
"end": 394,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 360,
"end": 378,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 361,
"end": 377,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 370,
"end": 371,
"ctxt": 0
},
"value": "a",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 362,
"end": 368,
"ctxt": 0
},
"tail": false,
"cooked": "hello ",
"raw": "hello "
},
{
"type": "TemplateElement",
"span": {
"start": 372,
"end": 376,
"ctxt": 0
},
"tail": true,
"cooked": " bye",
"raw": " bye"
}
]
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 356,
"end": 394,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 381,
"end": 394,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 383,
"end": 392,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": 0.0,
"raw": "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
}