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

1437 lines
30 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 406,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 0,
"end": 15,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 29,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 21,
"end": 28,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 22,
"end": 28,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 24,
"end": 28,
"ctxt": 0
},
"kind": "void"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 31,
"end": 47,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 35,
"end": 37,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 37,
"end": 46,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 39,
"end": 46,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 48,
"end": 56,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 48,
"end": 55,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 48,
"end": 50,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 57,
"end": 68,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 57,
"end": 67,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 63,
"end": 67,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 69,
"end": 77,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 69,
"end": 76,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 69,
"end": 71,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 78,
"end": 88,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 78,
"end": 87,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 78,
"end": 80,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 89,
"end": 98,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 89,
"end": 97,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 89,
"end": 91,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 95,
"end": 97,
"ctxt": 0
},
"properties": []
}
}
},
{
"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": 140,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 133,
"end": 139,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 135,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 139,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 137,
"end": 139,
"ctxt": 0
},
"members": []
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 141,
"end": 149,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 141,
"end": 148,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 141,
"end": 143,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 150,
"end": 161,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 150,
"end": 160,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 150,
"end": 152,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 156,
"end": 160,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 162,
"end": 170,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 162,
"end": 169,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 162,
"end": 164,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 171,
"end": 181,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 171,
"end": 180,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 171,
"end": 173,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 177,
"end": 180,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 182,
"end": 191,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 182,
"end": 190,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 182,
"end": 184,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 188,
"end": 190,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 192,
"end": 203,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 192,
"end": 202,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 192,
"end": 194,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 198,
"end": 202,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 204,
"end": 220,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 204,
"end": 219,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 204,
"end": 206,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 210,
"end": 219,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 235,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 234,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 228,
"end": 234,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 230,
"end": 234,
"ctxt": 0
},
"kind": "void"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 236,
"end": 244,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 236,
"end": 243,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 236,
"end": 238,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 245,
"end": 256,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 245,
"end": 255,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 245,
"end": 247,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 251,
"end": 255,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 257,
"end": 264,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 257,
"end": 259,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 263,
"end": 264,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 266,
"end": 276,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 266,
"end": 275,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 266,
"end": 268,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 272,
"end": 275,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 277,
"end": 286,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 277,
"end": 285,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 277,
"end": 279,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 283,
"end": 285,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 287,
"end": 298,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 287,
"end": 297,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 287,
"end": 289,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NullLiteral",
"span": {
"start": 293,
"end": 297,
"ctxt": 0
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 299,
"end": 315,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 299,
"end": 314,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 299,
"end": 301,
"ctxt": 0
},
"value": "x3",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 305,
"end": 314,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 317,
"end": 332,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 321,
"end": 331,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 321,
"end": 323,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 323,
"end": 331,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 325,
"end": 331,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 333,
"end": 341,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 333,
"end": 340,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 333,
"end": 335,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 342,
"end": 353,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 342,
"end": 352,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 342,
"end": 344,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 348,
"end": 352,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 354,
"end": 363,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 354,
"end": 362,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "x4",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 360,
"end": 362,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 365,
"end": 375,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 369,
"end": 374,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 369,
"end": 371,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 371,
"end": 374,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"value": "E",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 376,
"end": 384,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 376,
"end": 383,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 376,
"end": 378,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 382,
"end": 383,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 385,
"end": 396,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 385,
"end": 395,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 385,
"end": 387,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 391,
"end": 395,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 397,
"end": 406,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 397,
"end": 405,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 397,
"end": 399,
"ctxt": 0
},
"value": "x5",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 403,
"end": 405,
"ctxt": 0
},
"properties": []
}
}
}
],
"interpreter": null
}