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

1281 lines
30 KiB
JSON

{
"type": "Script",
"span": {
"start": 33,
"end": 744,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 33,
"end": 46,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 37,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"value": "ANY",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 42,
"end": 45,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 47,
"end": 68,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 51,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 51,
"end": 58,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 60,
"end": 67,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 69,
"end": 88,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 73,
"end": 87,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"value": "NUMBER",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 87,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 81,
"end": 87,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 89,
"end": 108,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 93,
"end": 107,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"value": "STRING",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 99,
"end": 107,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 101,
"end": 107,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 109,
"end": 128,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 113,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 113,
"end": 119,
"ctxt": 0
},
"value": "OBJECT",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 127,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 121,
"end": 127,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 121,
"end": 127,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 152,
"end": 173,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 152,
"end": 172,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"value": "ANY",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 157,
"end": 164,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 166,
"end": 172,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 174,
"end": 198,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 174,
"end": 197,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 174,
"end": 181,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 183,
"end": 189,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 191,
"end": 197,
"ctxt": 0
},
"value": "STRING",
"optional": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 199,
"end": 222,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 199,
"end": 221,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 199,
"end": 205,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 207,
"end": 213,
"ctxt": 0
},
"value": "STRING",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 215,
"end": 221,
"ctxt": 0
},
"value": "OBJECT",
"optional": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 223,
"end": 243,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 223,
"end": 242,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 223,
"end": 229,
"ctxt": 0
},
"value": "STRING",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 231,
"end": 237,
"ctxt": 0
},
"value": "OBJECT",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 239,
"end": 242,
"ctxt": 0
},
"value": "ANY",
"optional": false
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 244,
"end": 265,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 244,
"end": 264,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 244,
"end": 250,
"ctxt": 0
},
"value": "OBJECT",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 252,
"end": 255,
"ctxt": 0
},
"value": "ANY",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 257,
"end": 264,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 324,
"end": 365,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 328,
"end": 364,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 328,
"end": 340,
"ctxt": 0
},
"value": "resultIsAny1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 343,
"end": 364,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 344,
"end": 363,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 344,
"end": 350,
"ctxt": 0
},
"value": "STRING",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 352,
"end": 358,
"ctxt": 0
},
"value": "OBJECT",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 360,
"end": 363,
"ctxt": 0
},
"value": "ANY",
"optional": false
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 366,
"end": 412,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 370,
"end": 411,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 370,
"end": 386,
"ctxt": 0
},
"value": "resultIsBoolean1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 389,
"end": 411,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 390,
"end": 410,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 390,
"end": 396,
"ctxt": 0
},
"value": "OBJECT",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 398,
"end": 401,
"ctxt": 0
},
"value": "ANY",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 403,
"end": 410,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 413,
"end": 458,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 417,
"end": 457,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 417,
"end": 432,
"ctxt": 0
},
"value": "resultIsNumber1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 435,
"end": 457,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 436,
"end": 456,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 436,
"end": 439,
"ctxt": 0
},
"value": "ANY",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 441,
"end": 448,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 450,
"end": 456,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 459,
"end": 507,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 463,
"end": 506,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 463,
"end": 478,
"ctxt": 0
},
"value": "resultIsString1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 481,
"end": 506,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 482,
"end": 505,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 482,
"end": 489,
"ctxt": 0
},
"value": "BOOLEAN",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 491,
"end": 497,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 499,
"end": 505,
"ctxt": 0
},
"value": "STRING",
"optional": false
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 508,
"end": 555,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 512,
"end": 554,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 527,
"ctxt": 0
},
"value": "resultIsObject1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 530,
"end": 554,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 531,
"end": 553,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 531,
"end": 537,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 539,
"end": 545,
"ctxt": 0
},
"value": "STRING",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 547,
"end": 553,
"ctxt": 0
},
"value": "OBJECT",
"optional": false
}
]
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 582,
"end": 596,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 582,
"end": 595,
"ctxt": 0
},
"expressions": [
{
"type": "NullLiteral",
"span": {
"start": 582,
"end": 586,
"ctxt": 0
}
},
{
"type": "BooleanLiteral",
"span": {
"start": 588,
"end": 592,
"ctxt": 0
},
"value": true
},
{
"type": "NumericLiteral",
"span": {
"start": 594,
"end": 595,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 597,
"end": 638,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 597,
"end": 637,
"ctxt": 0
},
"expressions": [
{
"type": "UpdateExpression",
"span": {
"start": 597,
"end": 605,
"ctxt": 0
},
"operator": "++",
"prefix": true,
"argument": {
"type": "Identifier",
"span": {
"start": 599,
"end": 605,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
}
},
{
"type": "CallExpression",
"span": {
"start": 607,
"end": 623,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 607,
"end": 620,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 607,
"end": 613,
"ctxt": 0
},
"value": "STRING",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 614,
"end": 620,
"ctxt": 0
},
"value": "charAt",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 621,
"end": 622,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
{
"type": "NewExpression",
"span": {
"start": 625,
"end": 637,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 629,
"end": 635,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"arguments": [],
"typeArguments": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 640,
"end": 678,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 644,
"end": 677,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 644,
"end": 659,
"ctxt": 0
},
"value": "resultIsNumber2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 662,
"end": 677,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 663,
"end": 676,
"ctxt": 0
},
"expressions": [
{
"type": "NullLiteral",
"span": {
"start": 663,
"end": 667,
"ctxt": 0
}
},
{
"type": "BooleanLiteral",
"span": {
"start": 669,
"end": 673,
"ctxt": 0
},
"value": true
},
{
"type": "NumericLiteral",
"span": {
"start": 675,
"end": 676,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 679,
"end": 744,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 683,
"end": 743,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 683,
"end": 698,
"ctxt": 0
},
"value": "resultIsObject2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 701,
"end": 743,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 702,
"end": 742,
"ctxt": 0
},
"expressions": [
{
"type": "UpdateExpression",
"span": {
"start": 702,
"end": 710,
"ctxt": 0
},
"operator": "++",
"prefix": true,
"argument": {
"type": "Identifier",
"span": {
"start": 704,
"end": 710,
"ctxt": 0
},
"value": "NUMBER",
"optional": false
}
},
{
"type": "CallExpression",
"span": {
"start": 712,
"end": 728,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 712,
"end": 725,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 712,
"end": 718,
"ctxt": 0
},
"value": "STRING",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 719,
"end": 725,
"ctxt": 0
},
"value": "charAt",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 726,
"end": 727,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
{
"type": "NewExpression",
"span": {
"start": 730,
"end": 742,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 734,
"end": 740,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"arguments": [],
"typeArguments": null
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}