swc/crates/swc_ecma_parser/tests/tsc/logicalAssignment7.json
2022-02-04 17:08:38 +09:00

816 lines
22 KiB
JSON

{
"type": "Script",
"span": {
"start": 61,
"end": 440,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 75,
"end": 104,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 75,
"end": 104,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 82,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 84,
"end": 104,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 84,
"end": 92,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 84,
"end": 90,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 95,
"end": 104,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 106,
"end": 136,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 106,
"end": 136,
"ctxt": 0
},
"value": "results1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 114,
"end": 136,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 116,
"end": 136,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 116,
"end": 124,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 136,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 61,
"end": 186,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 138,
"end": 186,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 144,
"end": 184,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 144,
"end": 183,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 144,
"end": 178,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 144,
"end": 173,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 145,
"end": 172,
"ctxt": 0
},
"operator": "||=",
"left": {
"type": "Identifier",
"span": {
"start": 145,
"end": 152,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 157,
"end": 172,
"ctxt": 0
},
"operator": "||=",
"left": {
"type": "Identifier",
"span": {
"start": 157,
"end": 165,
"ctxt": 0
},
"value": "results1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 170,
"end": 172,
"ctxt": 0
},
"elements": []
}
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 174,
"end": 178,
"ctxt": 0
},
"value": "push",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 179,
"end": 182,
"ctxt": 0
},
"value": 100.0
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 197,
"end": 201,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 202,
"end": 231,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 202,
"end": 231,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 209,
"end": 231,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 211,
"end": 231,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 211,
"end": 219,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 211,
"end": 217,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 222,
"end": 231,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 233,
"end": 263,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 233,
"end": 263,
"ctxt": 0
},
"value": "results1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 241,
"end": 263,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 243,
"end": 263,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 243,
"end": 251,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 243,
"end": 249,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 254,
"end": 263,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 188,
"end": 313,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 265,
"end": 313,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 271,
"end": 311,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 271,
"end": 310,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 271,
"end": 305,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 271,
"end": 300,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 272,
"end": 299,
"ctxt": 0
},
"operator": "??=",
"left": {
"type": "Identifier",
"span": {
"start": 272,
"end": 279,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 284,
"end": 299,
"ctxt": 0
},
"operator": "??=",
"left": {
"type": "Identifier",
"span": {
"start": 284,
"end": 292,
"ctxt": 0
},
"value": "results1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 297,
"end": 299,
"ctxt": 0
},
"elements": []
}
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 301,
"end": 305,
"ctxt": 0
},
"value": "push",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 306,
"end": 309,
"ctxt": 0
},
"value": 100.0
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 324,
"end": 328,
"ctxt": 0
},
"value": "foo3",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 329,
"end": 358,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 329,
"end": 358,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 336,
"end": 358,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 338,
"end": 358,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 338,
"end": 346,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 338,
"end": 344,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 349,
"end": 358,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 360,
"end": 390,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 360,
"end": 390,
"ctxt": 0
},
"value": "results1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 368,
"end": 390,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 370,
"end": 390,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 370,
"end": 378,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 370,
"end": 376,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 381,
"end": 390,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 315,
"end": 440,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 392,
"end": 440,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 398,
"end": 438,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 398,
"end": 437,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 398,
"end": 432,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 398,
"end": 427,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 399,
"end": 426,
"ctxt": 0
},
"operator": "&&=",
"left": {
"type": "Identifier",
"span": {
"start": 399,
"end": 406,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AssignmentExpression",
"span": {
"start": 411,
"end": 426,
"ctxt": 0
},
"operator": "&&=",
"left": {
"type": "Identifier",
"span": {
"start": 411,
"end": 419,
"ctxt": 0
},
"value": "results1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrayExpression",
"span": {
"start": 424,
"end": 426,
"ctxt": 0
},
"elements": []
}
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 428,
"end": 432,
"ctxt": 0
},
"value": "push",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": 100.0
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}