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

1002 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 106,
"end": 485,
"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": 234,
"end": 252,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 238,
"end": 251,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 238,
"end": 240,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 243,
"end": 251,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 243,
"end": 247,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 253,
"end": 271,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 257,
"end": 270,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 257,
"end": 259,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 262,
"end": 270,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 262,
"end": 266,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 272,
"end": 290,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 276,
"end": 289,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 276,
"end": 278,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 281,
"end": 289,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 281,
"end": 285,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 288,
"end": 289,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 291,
"end": 309,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 295,
"end": 308,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 295,
"end": 297,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 300,
"end": 308,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "NullLiteral",
"span": {
"start": 304,
"end": 308,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 310,
"end": 328,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 314,
"end": 327,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 314,
"end": 316,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 319,
"end": 327,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 319,
"end": 320,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "NullLiteral",
"span": {
"start": 323,
"end": 327,
"ctxt": 0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 329,
"end": 347,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 333,
"end": 346,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 333,
"end": 335,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 338,
"end": 346,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 338,
"end": 342,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 364,
"end": 382,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 368,
"end": 381,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 368,
"end": 370,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 373,
"end": 381,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 373,
"end": 377,
"ctxt": 0
}
},
"right": {
"type": "Identifier",
"span": {
"start": 380,
"end": 381,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 383,
"end": 404,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 387,
"end": 403,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 387,
"end": 389,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 392,
"end": 403,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 392,
"end": 396,
"ctxt": 0
}
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 399,
"end": 403,
"ctxt": 0
},
"value": true
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 405,
"end": 431,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 409,
"end": 430,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 409,
"end": 411,
"ctxt": 0
},
"value": "r9",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 414,
"end": 430,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 414,
"end": 418,
"ctxt": 0
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 421,
"end": 430,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 426,
"end": 428,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 432,
"end": 455,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 436,
"end": 454,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 436,
"end": 439,
"ctxt": 0
},
"value": "r10",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 442,
"end": 454,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 442,
"end": 446,
"ctxt": 0
}
},
"right": {
"type": "CallExpression",
"span": {
"start": 449,
"end": 454,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 449,
"end": 452,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 485,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 484,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "r11",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 466,
"end": 484,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NullLiteral",
"span": {
"start": 466,
"end": 470,
"ctxt": 0
}
},
"right": {
"type": "ParenthesisExpression",
"span": {
"start": 473,
"end": 484,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 474,
"end": 483,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 480,
"end": 483,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}