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

950 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 316,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 38,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 37,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 33,
"ctxt": 0
},
"value": "globalCounter",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 36,
"end": 37,
"ctxt": 0
},
"value": 0.0
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 48,
"end": 51,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 39,
"end": 102,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 54,
"end": 102,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 60,
"end": 79,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 60,
"end": 78,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 60,
"end": 73,
"ctxt": 0
},
"value": "globalCounter",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ReturnStatement",
"span": {
"start": 84,
"end": 100,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 91,
"end": 99,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "NumericLiteral",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": 0.0
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": 2.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 103,
"end": 125,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 103,
"end": 124,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 103,
"end": 111,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 103,
"end": 108,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 108,
"end": 111,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 116,
"end": 124,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 116,
"end": 121,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 116,
"end": 119,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 121,
"end": 124,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": 0.0
}
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 126,
"end": 166,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 130,
"end": 165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 130,
"end": 141,
"ctxt": 0
},
"value": "result_foo1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AssignmentExpression",
"span": {
"start": 144,
"end": 165,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 144,
"end": 149,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 144,
"end": 147,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 157,
"end": 165,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 157,
"end": 162,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 157,
"end": 160,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 162,
"end": 165,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": 0.0
}
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 167,
"end": 195,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 167,
"end": 194,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 167,
"end": 175,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 167,
"end": 172,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 172,
"end": 175,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 180,
"end": 194,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 180,
"end": 188,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 180,
"end": 185,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 180,
"end": 183,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 185,
"end": 188,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": 2.0
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 196,
"end": 242,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 200,
"end": 241,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 200,
"end": 211,
"ctxt": 0
},
"value": "result_foo2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AssignmentExpression",
"span": {
"start": 214,
"end": 241,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 214,
"end": 222,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 214,
"end": 219,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 214,
"end": 217,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 219,
"end": 222,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 220,
"end": 221,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 227,
"end": 241,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 227,
"end": 235,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 232,
"end": 235,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": 2.0
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 243,
"end": 270,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 243,
"end": 269,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 243,
"end": 251,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 243,
"end": 248,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 243,
"end": 246,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 248,
"end": 251,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 256,
"end": 269,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "MemberExpression",
"span": {
"start": 256,
"end": 264,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 256,
"end": 261,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 256,
"end": 259,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 261,
"end": 264,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": 2.0
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 271,
"end": 316,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 275,
"end": 315,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 275,
"end": 286,
"ctxt": 0
},
"value": "result_foo3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AssignmentExpression",
"span": {
"start": 289,
"end": 315,
"ctxt": 0
},
"operator": "**=",
"left": {
"type": "MemberExpression",
"span": {
"start": 289,
"end": 297,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 289,
"end": 294,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 289,
"end": 292,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 294,
"end": 297,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 302,
"end": 315,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "MemberExpression",
"span": {
"start": 302,
"end": 310,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 302,
"end": 307,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 302,
"end": 305,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Computed",
"span": {
"start": 307,
"end": 310,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": 0.0
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 314,
"end": 315,
"ctxt": 0
},
"value": 2.0
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}