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

651 lines
18 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 17,
"end": 244,
"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": "VariableDeclaration",
"span": {
"start": 59,
"end": 244,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 63,
"end": 244,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 67,
"end": 244,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 74,
"end": 75,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 85,
"end": 88,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
"value": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "n",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 97,
"end": 104,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 113,
"end": 120,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 114,
"end": 119,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "s",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "n",
"optional": false
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 129,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 130,
"end": 132,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"value": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 143,
"end": 145,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 155,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 179,
"end": 190,
"ctxt": 0
},
"expression": {
"type": "TsTypeAssertion",
"span": {
"start": 180,
"end": 189,
"ctxt": 0
},
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
},
"value": true
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"kind": "any"
}
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 199,
"end": 212,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 200,
"end": 211,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 201,
"end": 210,
"ctxt": 0
},
"tail": true,
"cooked": "hello bye",
"raw": "hello bye"
}
]
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 222,
"end": 238,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "a",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 223,
"end": 229,
"ctxt": 0
},
"tail": false,
"cooked": "hello ",
"raw": "hello "
},
{
"type": "TemplateElement",
"span": {
"start": 233,
"end": 237,
"ctxt": 0
},
"tail": true,
"cooked": " bye",
"raw": " bye"
}
]
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}