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

2760 lines
77 KiB
JSON

{
"type": "Script",
"span": {
"start": 26,
"end": 1351,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 26,
"end": 44,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 30,
"end": 43,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 30,
"end": 34,
"ctxt": 0
},
"value": "cond",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 34,
"end": 43,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 36,
"end": 43,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"value": "len",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 59,
"end": 68,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 59,
"end": 68,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 60,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 62,
"end": 68,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 46,
"end": 94,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 70,
"end": 94,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 76,
"end": 92,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 83,
"end": 91,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 85,
"end": 91,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 105,
"end": 107,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 96,
"end": 226,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 110,
"end": 226,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 116,
"end": 149,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 120,
"end": 148,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 123,
"end": 148,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 132,
"end": 138,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 141,
"end": 148,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 154,
"end": 161,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 158,
"end": 160,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 166,
"end": 217,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 173,
"end": 177,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 179,
"end": 217,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 189,
"end": 200,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 189,
"end": 199,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 193,
"end": 196,
"ctxt": 0
},
"value": "len",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 209,
"end": 211,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 222,
"end": 224,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 237,
"end": 239,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 228,
"end": 358,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 242,
"end": 358,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 248,
"end": 281,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 252,
"end": 280,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 253,
"end": 280,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 255,
"end": 280,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 255,
"end": 261,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 264,
"end": 270,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 273,
"end": 280,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 286,
"end": 293,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 286,
"end": 292,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 290,
"end": 292,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 298,
"end": 349,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 305,
"end": 309,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 311,
"end": 349,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 321,
"end": 323,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 332,
"end": 343,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 332,
"end": 342,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 332,
"end": 333,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 336,
"end": 342,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 336,
"end": 339,
"ctxt": 0
},
"value": "len",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 377,
"end": 380,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 381,
"end": 390,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 381,
"end": 390,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 382,
"end": 390,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 384,
"end": 390,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 360,
"end": 400,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 391,
"end": 399,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 393,
"end": 399,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 418,
"end": 421,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 422,
"end": 431,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 422,
"end": 431,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 423,
"end": 431,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 425,
"end": 431,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 401,
"end": 441,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 432,
"end": 440,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 434,
"end": 440,
"ctxt": 0
},
"kind": "string"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 452,
"end": 454,
"ctxt": 0
},
"value": "g1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 443,
"end": 573,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 457,
"end": 573,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 463,
"end": 496,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 467,
"end": 495,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 468,
"end": 495,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 470,
"end": 495,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 470,
"end": 476,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 479,
"end": 485,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 488,
"end": 495,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 501,
"end": 508,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 501,
"end": 507,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 501,
"end": 502,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 505,
"end": 507,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 513,
"end": 564,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 520,
"end": 524,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 526,
"end": 564,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 536,
"end": 547,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 536,
"end": 546,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 536,
"end": 537,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 540,
"end": 546,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 540,
"end": 543,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 544,
"end": 545,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 556,
"end": 558,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 556,
"end": 557,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 569,
"end": 571,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 569,
"end": 570,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 584,
"end": 586,
"ctxt": 0
},
"value": "g2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 575,
"end": 705,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 589,
"end": 705,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 595,
"end": 628,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 599,
"end": 627,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 599,
"end": 600,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 600,
"end": 627,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 602,
"end": 627,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 602,
"end": 608,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 611,
"end": 617,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 620,
"end": 627,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 633,
"end": 640,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 633,
"end": 639,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 633,
"end": 634,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 637,
"end": 639,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 645,
"end": 696,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 652,
"end": 656,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 658,
"end": 696,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 668,
"end": 670,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 668,
"end": 669,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 679,
"end": 690,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 679,
"end": 689,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 679,
"end": 680,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 683,
"end": 689,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 683,
"end": 686,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 687,
"end": 688,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 701,
"end": 703,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 701,
"end": 702,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 716,
"end": 724,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 725,
"end": 743,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 725,
"end": 743,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 726,
"end": 743,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 728,
"end": 743,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 728,
"end": 734,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 737,
"end": 743,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 707,
"end": 771,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 753,
"end": 771,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 759,
"end": 769,
"ctxt": 0
},
"argument": {
"type": "UnaryExpression",
"span": {
"start": 766,
"end": 768,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 767,
"end": 768,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 744,
"end": 752,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 746,
"end": 752,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 782,
"end": 784,
"ctxt": 0
},
"value": "h1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 773,
"end": 897,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 787,
"end": 897,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 793,
"end": 826,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 797,
"end": 825,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 797,
"end": 798,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 798,
"end": 825,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 800,
"end": 825,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 800,
"end": 806,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 809,
"end": 815,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 818,
"end": 825,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 831,
"end": 839,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 831,
"end": 838,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 831,
"end": 832,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 835,
"end": 838,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 844,
"end": 895,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 851,
"end": 855,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 857,
"end": 895,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 867,
"end": 878,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 867,
"end": 877,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 867,
"end": 868,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 871,
"end": 877,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "UnaryExpression",
"span": {
"start": 871,
"end": 873,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 876,
"end": 877,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 887,
"end": 889,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 887,
"end": 888,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 908,
"end": 910,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 899,
"end": 1032,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 913,
"end": 1032,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 919,
"end": 952,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 923,
"end": 951,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 923,
"end": 924,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 924,
"end": 951,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 926,
"end": 951,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 926,
"end": 932,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 935,
"end": 941,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 944,
"end": 951,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 957,
"end": 965,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 957,
"end": 964,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 957,
"end": 958,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 961,
"end": 964,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 970,
"end": 1030,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 977,
"end": 981,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 983,
"end": 1030,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 993,
"end": 1013,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 993,
"end": 1012,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 993,
"end": 994,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 997,
"end": 1012,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "CallExpression",
"span": {
"start": 997,
"end": 1008,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 997,
"end": 1005,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1006,
"end": 1007,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1011,
"end": 1012,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1022,
"end": 1024,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1022,
"end": 1023,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1043,
"end": 1045,
"ctxt": 0
},
"value": "h3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1034,
"end": 1186,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1048,
"end": 1186,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1054,
"end": 1087,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1058,
"end": 1086,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1058,
"end": 1059,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1059,
"end": 1086,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1061,
"end": 1086,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1061,
"end": 1067,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1070,
"end": 1076,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1079,
"end": 1086,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1092,
"end": 1100,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1092,
"end": 1099,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1092,
"end": 1093,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1096,
"end": 1099,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1105,
"end": 1184,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1112,
"end": 1116,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1118,
"end": 1184,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1128,
"end": 1148,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1132,
"end": 1147,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1132,
"end": 1133,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1136,
"end": 1147,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1136,
"end": 1144,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1145,
"end": 1146,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1157,
"end": 1167,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1157,
"end": 1166,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1157,
"end": 1158,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1161,
"end": 1166,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1161,
"end": 1162,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1165,
"end": 1166,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1176,
"end": 1178,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1176,
"end": 1177,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1197,
"end": 1199,
"ctxt": 0
},
"value": "h4",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1188,
"end": 1351,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1202,
"end": 1351,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1208,
"end": 1241,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1212,
"end": 1240,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1212,
"end": 1213,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1213,
"end": 1240,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1215,
"end": 1240,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1215,
"end": 1221,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1224,
"end": 1230,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1233,
"end": 1240,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1246,
"end": 1254,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1246,
"end": 1253,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1246,
"end": 1247,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1250,
"end": 1253,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1259,
"end": 1349,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1266,
"end": 1270,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1272,
"end": 1349,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1282,
"end": 1284,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1282,
"end": 1283,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1293,
"end": 1313,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1297,
"end": 1312,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1297,
"end": 1298,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1301,
"end": 1312,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1301,
"end": 1309,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1310,
"end": 1311,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1322,
"end": 1332,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1322,
"end": 1331,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1322,
"end": 1323,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1326,
"end": 1331,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1326,
"end": 1327,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1330,
"end": 1331,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1341,
"end": 1343,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1341,
"end": 1342,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}