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

1393 lines
32 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 107,
"end": 665,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 107,
"end": 125,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": null
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 127,
"end": 138,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 131,
"end": 137,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 139,
"end": 153,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 143,
"end": 152,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 154,
"end": 163,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 159,
"end": 162,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "E",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 164,
"end": 178,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 168,
"end": 177,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 169,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 171,
"end": 177,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 199,
"end": 227,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 203,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 203,
"end": 205,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 205,
"end": 210,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 207,
"end": 210,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 213,
"end": 226,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 213,
"end": 222,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 228,
"end": 256,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 232,
"end": 255,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 232,
"end": 234,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 234,
"end": 239,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 236,
"end": 239,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 242,
"end": 255,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 246,
"end": 255,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 285,
"end": 308,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 289,
"end": 307,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 289,
"end": 291,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 294,
"end": 307,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 294,
"end": 303,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 309,
"end": 332,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 313,
"end": 331,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 313,
"end": 315,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 318,
"end": 331,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 318,
"end": 327,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 333,
"end": 356,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 337,
"end": 355,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 337,
"end": 339,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 342,
"end": 355,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 342,
"end": 351,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 357,
"end": 382,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 361,
"end": 381,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 361,
"end": 363,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 366,
"end": 381,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 378,
"end": 381,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 378,
"end": 379,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 380,
"end": 381,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 383,
"end": 411,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 387,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 387,
"end": 389,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 392,
"end": 410,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 392,
"end": 401,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 404,
"end": 410,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 405,
"end": 410,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 406,
"end": 409,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 412,
"end": 435,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 416,
"end": 434,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 416,
"end": 418,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 421,
"end": 434,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 425,
"end": 434,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 436,
"end": 459,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 440,
"end": 458,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 440,
"end": 442,
"ctxt": 0
},
"value": "r9",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 445,
"end": 458,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 445,
"end": 446,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "Identifier",
"span": {
"start": 449,
"end": 458,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 460,
"end": 483,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 464,
"end": 483,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 464,
"end": 467,
"ctxt": 0
},
"value": "r10",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 470,
"end": 483,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 474,
"end": 483,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 484,
"end": 510,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 488,
"end": 509,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 488,
"end": 491,
"ctxt": 0
},
"value": "r11",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 494,
"end": 509,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 494,
"end": 497,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 496,
"end": 497,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 500,
"end": 509,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 511,
"end": 540,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 515,
"end": 539,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 515,
"end": 518,
"ctxt": 0
},
"value": "r12",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 521,
"end": 539,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 521,
"end": 527,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 521,
"end": 522,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 522,
"end": 527,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 523,
"end": 526,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 530,
"end": 539,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 564,
"end": 588,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 568,
"end": 587,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 568,
"end": 571,
"ctxt": 0
},
"value": "r13",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 574,
"end": 587,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 574,
"end": 583,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 586,
"end": 587,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 589,
"end": 614,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 593,
"end": 613,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 593,
"end": 596,
"ctxt": 0
},
"value": "r14",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 599,
"end": 613,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 599,
"end": 608,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 611,
"end": 613,
"ctxt": 0
},
"value": "",
"raw": "''"
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 615,
"end": 639,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 619,
"end": 638,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 619,
"end": 622,
"ctxt": 0
},
"value": "r15",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 625,
"end": 638,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 625,
"end": 626,
"ctxt": 0
},
"value": "d",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 629,
"end": 638,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 640,
"end": 665,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 644,
"end": 664,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 644,
"end": 647,
"ctxt": 0
},
"value": "r16",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 650,
"end": 664,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 650,
"end": 652,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"right": {
"type": "Identifier",
"span": {
"start": 655,
"end": 664,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
}
],
"interpreter": null
}