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

1024 lines
24 KiB
JSON

{
"type": "Script",
"span": {
"start": 106,
"end": 545,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 106,
"end": 147,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 127,
"end": 147,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 129,
"end": 145,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 136,
"end": 145,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 120,
"end": 126,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 122,
"end": 126,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 149,
"end": 164,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 153,
"end": 163,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 154,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 156,
"end": 163,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 165,
"end": 179,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 169,
"end": 178,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 170,
"end": 178,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 172,
"end": 178,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 172,
"end": 178,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 180,
"end": 192,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 184,
"end": 191,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 184,
"end": 185,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 185,
"end": 191,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 187,
"end": 191,
"ctxt": 0
},
"kind": "void"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 193,
"end": 207,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 197,
"end": 206,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 198,
"end": 206,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 200,
"end": 206,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 200,
"end": 206,
"ctxt": 0
},
"value": "Number",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 239,
"end": 262,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 243,
"end": 261,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 243,
"end": 245,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 248,
"end": 261,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 248,
"end": 257,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 263,
"end": 286,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 267,
"end": 285,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 267,
"end": 269,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 272,
"end": 285,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 272,
"end": 281,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 284,
"end": 285,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 287,
"end": 310,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 291,
"end": 309,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 291,
"end": 293,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 296,
"end": 309,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 296,
"end": 305,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 311,
"end": 334,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 315,
"end": 333,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 315,
"end": 317,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 320,
"end": 333,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 324,
"end": 333,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 335,
"end": 358,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 339,
"end": 357,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 339,
"end": 341,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 344,
"end": 357,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 348,
"end": 357,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 359,
"end": 382,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 363,
"end": 381,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 363,
"end": 365,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 368,
"end": 381,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 368,
"end": 377,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 380,
"end": 381,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 399,
"end": 422,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 403,
"end": 421,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 403,
"end": 405,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 408,
"end": 421,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 408,
"end": 417,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 420,
"end": 421,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 423,
"end": 449,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 427,
"end": 448,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 427,
"end": 429,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 432,
"end": 448,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 432,
"end": 441,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 444,
"end": 448,
"ctxt": 0
},
"value": true
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 450,
"end": 481,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 454,
"end": 480,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 454,
"end": 456,
"ctxt": 0
},
"value": "r9",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 459,
"end": 480,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 459,
"end": 468,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 471,
"end": 480,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 473,
"end": 474,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 476,
"end": 478,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 482,
"end": 510,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 486,
"end": 509,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 486,
"end": 489,
"ctxt": 0
},
"value": "r10",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 492,
"end": 509,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 492,
"end": 501,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "CallExpression",
"span": {
"start": 504,
"end": 509,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 504,
"end": 507,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 511,
"end": 545,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 515,
"end": 544,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 515,
"end": 518,
"ctxt": 0
},
"value": "r11",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 521,
"end": 544,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 521,
"end": 530,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"right": {
"type": "ParenthesisExpression",
"span": {
"start": 533,
"end": 544,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 534,
"end": 543,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 540,
"end": 543,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}