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

969 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 268,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 1,
"end": 19,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 6,
"end": 7,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 16,
"end": 17,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 16,
"end": 17,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": null
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 21,
"end": 32,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 25,
"end": 31,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 26,
"end": 31,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 28,
"end": 31,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 33,
"end": 47,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 37,
"end": 46,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 38,
"end": 46,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 48,
"end": 57,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 52,
"end": 56,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "E",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 59,
"end": 71,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 63,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 65,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 67,
"end": 70,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 72,
"end": 80,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 72,
"end": 79,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 81,
"end": 89,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 81,
"end": 88,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 81,
"end": 83,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 90,
"end": 98,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 99,
"end": 110,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 99,
"end": 109,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 99,
"end": 101,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 105,
"end": 109,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 111,
"end": 127,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 111,
"end": 126,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 117,
"end": 126,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 129,
"end": 144,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 133,
"end": 143,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 135,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 143,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 137,
"end": 143,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 145,
"end": 153,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 145,
"end": 152,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 145,
"end": 147,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 154,
"end": 161,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 154,
"end": 156,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 163,
"end": 171,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 163,
"end": 170,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 163,
"end": 165,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 172,
"end": 183,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 172,
"end": 182,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 172,
"end": 174,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 178,
"end": 182,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 184,
"end": 200,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 184,
"end": 199,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 184,
"end": 186,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 190,
"end": 199,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 202,
"end": 212,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 206,
"end": 211,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 206,
"end": 208,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 208,
"end": 211,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "E",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 213,
"end": 221,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 213,
"end": 220,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 213,
"end": 215,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 219,
"end": 220,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 222,
"end": 230,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 222,
"end": 229,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 222,
"end": 224,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 231,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 231,
"end": 238,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 231,
"end": 233,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 240,
"end": 251,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 240,
"end": 250,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 246,
"end": 250,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 252,
"end": 268,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 252,
"end": 267,
"ctxt": 0
},
"operator": "*=",
"left": {
"type": "Identifier",
"span": {
"start": 252,
"end": 254,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 258,
"end": 267,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
}
],
"interpreter": null
}