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

1440 lines
30 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 407,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 1,
"end": 16,
"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": "VariableDeclaration",
"span": {
"start": 18,
"end": 30,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 22,
"end": 29,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 23,
"end": 29,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 25,
"end": 29,
"ctxt": 0
},
"kind": "void"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 32,
"end": 48,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 36,
"end": 47,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 36,
"end": 38,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 38,
"end": 47,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 40,
"end": 47,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 49,
"end": 57,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 49,
"end": 56,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 49,
"end": 51,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 58,
"end": 69,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 58,
"end": 68,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 58,
"end": 60,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 70,
"end": 78,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 70,
"end": 77,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 70,
"end": 72,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 79,
"end": 89,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 79,
"end": 88,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 79,
"end": 81,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 85,
"end": 88,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 90,
"end": 99,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 90,
"end": 98,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 96,
"end": 98,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 100,
"end": 111,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 100,
"end": 110,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 100,
"end": 102,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 106,
"end": 110,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 112,
"end": 128,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 112,
"end": 127,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 112,
"end": 114,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 118,
"end": 127,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 130,
"end": 141,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 134,
"end": 140,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 136,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"members": []
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 142,
"end": 150,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 142,
"end": 149,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 142,
"end": 144,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 151,
"end": 162,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 151,
"end": 161,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 151,
"end": 153,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 157,
"end": 161,
"ctxt": 0
},
"value": true
}
}
},
{
"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": "NumericLiteral",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 172,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 172,
"end": 181,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 172,
"end": 174,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 183,
"end": 192,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 183,
"end": 191,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 183,
"end": 185,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 189,
"end": 191,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 193,
"end": 204,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 193,
"end": 203,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 193,
"end": 195,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 199,
"end": 203,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 205,
"end": 221,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 205,
"end": 220,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 205,
"end": 207,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 211,
"end": 220,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 223,
"end": 236,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 227,
"end": 235,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 227,
"end": 229,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 229,
"end": 235,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 231,
"end": 235,
"ctxt": 0
},
"kind": "void"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 237,
"end": 245,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 237,
"end": 244,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 237,
"end": 239,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 243,
"end": 244,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 246,
"end": 257,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 246,
"end": 256,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 246,
"end": 248,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 252,
"end": 256,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 258,
"end": 266,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 258,
"end": 265,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 258,
"end": 260,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 267,
"end": 277,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 267,
"end": 269,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 273,
"end": 276,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 278,
"end": 287,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 278,
"end": 286,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 278,
"end": 280,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 284,
"end": 286,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 288,
"end": 299,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 288,
"end": 298,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 288,
"end": 290,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 294,
"end": 298,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 300,
"end": 316,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 300,
"end": 315,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 300,
"end": 302,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 306,
"end": 315,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 318,
"end": 333,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 322,
"end": 332,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 322,
"end": 324,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 324,
"end": 332,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 326,
"end": 332,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 334,
"end": 342,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 334,
"end": 341,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 334,
"end": 336,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 343,
"end": 354,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 343,
"end": 353,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 343,
"end": 345,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 349,
"end": 353,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 355,
"end": 364,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 355,
"end": 363,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 355,
"end": 357,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 361,
"end": 363,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 366,
"end": 376,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 370,
"end": 375,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 370,
"end": 372,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 372,
"end": 375,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 374,
"end": 375,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 374,
"end": 375,
"ctxt": 0
},
"value": "E",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 377,
"end": 385,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 377,
"end": 384,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 377,
"end": 379,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 386,
"end": 397,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 386,
"end": 396,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 386,
"end": 388,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 392,
"end": 396,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 398,
"end": 407,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 398,
"end": 406,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 398,
"end": 400,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 404,
"end": 406,
"ctxt": 0
},
"properties": []
}
}
}
],
"interpreter": null
}