swc/crates/swc_ecma_parser/tests/tsc/computedPropertyNames4_ES5.json
2022-03-22 07:54:08 +00:00

641 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 243,
"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": "VariableDeclaration",
"span": {
"start": 58,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 62,
"end": 243,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 66,
"end": 243,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
"value": {
"type": "Identifier",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 96,
"end": 103,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 97,
"end": 102,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 101,
"end": 102,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 112,
"end": 119,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 113,
"end": 118,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "n",
"optional": false
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": 2.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 128,
"end": 132,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 129,
"end": 131,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"value": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 141,
"end": 145,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 142,
"end": 144,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": 0.0
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 166,
"end": 169,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": 1.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 178,
"end": 189,
"ctxt": 0
},
"expression": {
"type": "TsTypeAssertion",
"span": {
"start": 179,
"end": 188,
"ctxt": 0
},
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"value": true
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 180,
"end": 183,
"ctxt": 0
},
"kind": "any"
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 198,
"end": 211,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 199,
"end": 210,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 200,
"end": 209,
"ctxt": 0
},
"tail": true,
"cooked": "hello bye",
"raw": "hello bye"
}
]
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 220,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 221,
"end": 237,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "a",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"tail": false,
"cooked": "hello ",
"raw": "hello "
},
{
"type": "TemplateElement",
"span": {
"start": 232,
"end": 236,
"ctxt": 0
},
"tail": true,
"cooked": " bye",
"raw": " bye"
}
]
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}