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

1361 lines
31 KiB
JSON

{
"type": "Script",
"span": {
"start": 107,
"end": 570,
"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": 194,
"end": 217,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 200,
"end": 205,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 202,
"end": 205,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 208,
"end": 212,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 218,
"end": 241,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 222,
"end": 240,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 222,
"end": 224,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 224,
"end": 229,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 226,
"end": 229,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 232,
"end": 240,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "NullLiteral",
"span": {
"start": 236,
"end": 240,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 265,
"end": 283,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 269,
"end": 282,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 269,
"end": 271,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 274,
"end": 282,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 274,
"end": 278,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 284,
"end": 302,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 288,
"end": 301,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 288,
"end": 290,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 293,
"end": 301,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 293,
"end": 297,
"ctxt": 0
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 303,
"end": 321,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 307,
"end": 320,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 307,
"end": 309,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 312,
"end": 320,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 312,
"end": 316,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 319,
"end": 320,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 322,
"end": 342,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 326,
"end": 341,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 326,
"end": 328,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 331,
"end": 341,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 331,
"end": 335,
"ctxt": 0
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 338,
"end": 341,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 343,
"end": 366,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 347,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 347,
"end": 349,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 352,
"end": 365,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 352,
"end": 356,
"ctxt": 0
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 359,
"end": 365,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 360,
"end": 365,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 361,
"end": 364,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 367,
"end": 385,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 371,
"end": 384,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 371,
"end": 373,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 376,
"end": 384,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "NullLiteral",
"span": {
"start": 380,
"end": 384,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 386,
"end": 404,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 390,
"end": 403,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 390,
"end": 392,
"ctxt": 0
},
"value": "r9",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 395,
"end": 403,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 395,
"end": 396,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"right": {
"type": "NullLiteral",
"span": {
"start": 399,
"end": 403,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 405,
"end": 423,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 409,
"end": 423,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 409,
"end": 412,
"ctxt": 0
},
"value": "r10",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 415,
"end": 423,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "NullLiteral",
"span": {
"start": 419,
"end": 423,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 424,
"end": 445,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 428,
"end": 444,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 428,
"end": 431,
"ctxt": 0
},
"value": "r11",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 434,
"end": 444,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 434,
"end": 437,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NullLiteral",
"span": {
"start": 440,
"end": 444,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 446,
"end": 470,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 450,
"end": 469,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 450,
"end": 453,
"ctxt": 0
},
"value": "r12",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 456,
"end": 469,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 456,
"end": 462,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 456,
"end": 457,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 457,
"end": 462,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 458,
"end": 461,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
},
"right": {
"type": "NullLiteral",
"span": {
"start": 465,
"end": 469,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 489,
"end": 508,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 493,
"end": 507,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 493,
"end": 496,
"ctxt": 0
},
"value": "r13",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 499,
"end": 507,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 499,
"end": 503,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 506,
"end": 507,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 509,
"end": 529,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 513,
"end": 528,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 513,
"end": 516,
"ctxt": 0
},
"value": "r14",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 519,
"end": 528,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 519,
"end": 523,
"ctxt": 0
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 526,
"end": 528,
"ctxt": 0
},
"value": "",
"raw": "''"
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 530,
"end": 549,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 534,
"end": 548,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 534,
"end": 537,
"ctxt": 0
},
"value": "r15",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 540,
"end": 548,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 540,
"end": 541,
"ctxt": 0
},
"value": "d",
"optional": false
},
"right": {
"type": "NullLiteral",
"span": {
"start": 544,
"end": 548,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 550,
"end": 570,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 554,
"end": 569,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 554,
"end": 557,
"ctxt": 0
},
"value": "r16",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 560,
"end": 569,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 560,
"end": 562,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"right": {
"type": "NullLiteral",
"span": {
"start": 565,
"end": 569,
"ctxt": 0
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}