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

2760 lines
77 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 25,
"end": 1350,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 25,
"end": 43,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 29,
"end": 42,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 29,
"end": 33,
"ctxt": 0
},
"value": "cond",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 33,
"end": 42,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 35,
"end": 42,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "len",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 58,
"end": 67,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 58,
"end": 67,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 59,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 61,
"end": 67,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 45,
"end": 93,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 69,
"end": 93,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 75,
"end": 91,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 82,
"end": 90,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 82,
"end": 83,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 84,
"end": 90,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 104,
"end": 106,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 95,
"end": 225,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 109,
"end": 225,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 115,
"end": 148,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 119,
"end": 147,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 120,
"end": 147,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 122,
"end": 147,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 122,
"end": 128,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 131,
"end": 137,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 140,
"end": 147,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 153,
"end": 159,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 157,
"end": 159,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 165,
"end": 216,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 178,
"end": 216,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 188,
"end": 199,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 188,
"end": 198,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"value": "len",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 210,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 221,
"end": 223,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 236,
"end": 238,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 227,
"end": 357,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 241,
"end": 357,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 247,
"end": 280,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 251,
"end": 279,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 252,
"end": 279,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 254,
"end": 279,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 254,
"end": 260,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 263,
"end": 269,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 272,
"end": 279,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 285,
"end": 292,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 285,
"end": 291,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 289,
"end": 291,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 297,
"end": 348,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 304,
"end": 308,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 310,
"end": 348,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 320,
"end": 322,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 331,
"end": 342,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 331,
"end": 341,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 335,
"end": 341,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 335,
"end": 338,
"ctxt": 0
},
"value": "len",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 353,
"end": 355,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 376,
"end": 379,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 380,
"end": 389,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 380,
"end": 389,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 381,
"end": 389,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 383,
"end": 389,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 359,
"end": 399,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 390,
"end": 398,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 392,
"end": 398,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 421,
"end": 430,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 421,
"end": 430,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 422,
"end": 430,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 424,
"end": 430,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 400,
"end": 440,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 431,
"end": 439,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 433,
"end": 439,
"ctxt": 0
},
"kind": "string"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 451,
"end": 453,
"ctxt": 0
},
"value": "g1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 442,
"end": 572,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 456,
"end": 572,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 462,
"end": 495,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 466,
"end": 494,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 466,
"end": 467,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 467,
"end": 494,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 469,
"end": 494,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 469,
"end": 475,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 478,
"end": 484,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 487,
"end": 494,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 500,
"end": 507,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 500,
"end": 506,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 500,
"end": 501,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 504,
"end": 506,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 512,
"end": 563,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 519,
"end": 523,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 525,
"end": 563,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 535,
"end": 546,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 535,
"end": 545,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 535,
"end": 536,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 539,
"end": 545,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 539,
"end": 542,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 555,
"end": 557,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 555,
"end": 556,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 568,
"end": 570,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 568,
"end": 569,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 583,
"end": 585,
"ctxt": 0
},
"value": "g2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 574,
"end": 704,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 588,
"end": 704,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 594,
"end": 627,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 598,
"end": 626,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 598,
"end": 599,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 599,
"end": 626,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 601,
"end": 626,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 601,
"end": 607,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 610,
"end": 616,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 619,
"end": 626,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 632,
"end": 639,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 632,
"end": 638,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 632,
"end": 633,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 636,
"end": 638,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 644,
"end": 695,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 651,
"end": 655,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 657,
"end": 695,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 667,
"end": 669,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 667,
"end": 668,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 678,
"end": 689,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 678,
"end": 688,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 678,
"end": 679,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 682,
"end": 688,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 682,
"end": 685,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 686,
"end": 687,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 700,
"end": 702,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 700,
"end": 701,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 715,
"end": 723,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 724,
"end": 742,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 724,
"end": 742,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 725,
"end": 742,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 727,
"end": 742,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 727,
"end": 733,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 736,
"end": 742,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 706,
"end": 770,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 752,
"end": 770,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 758,
"end": 768,
"ctxt": 0
},
"argument": {
"type": "UnaryExpression",
"span": {
"start": 765,
"end": 767,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 766,
"end": 767,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 743,
"end": 751,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 745,
"end": 751,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 781,
"end": 783,
"ctxt": 0
},
"value": "h1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 772,
"end": 896,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 786,
"end": 896,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 792,
"end": 825,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 796,
"end": 824,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 796,
"end": 797,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 797,
"end": 824,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 799,
"end": 824,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 799,
"end": 805,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 808,
"end": 814,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 817,
"end": 824,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 830,
"end": 838,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 830,
"end": 837,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 830,
"end": 831,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 834,
"end": 837,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 843,
"end": 894,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 850,
"end": 854,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 856,
"end": 894,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 866,
"end": 877,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 866,
"end": 876,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 866,
"end": 867,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 870,
"end": 876,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "UnaryExpression",
"span": {
"start": 870,
"end": 872,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 871,
"end": 872,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 875,
"end": 876,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 886,
"end": 888,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 886,
"end": 887,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 907,
"end": 909,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 898,
"end": 1031,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 912,
"end": 1031,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 918,
"end": 951,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 922,
"end": 950,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 922,
"end": 923,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 923,
"end": 950,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 925,
"end": 950,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 925,
"end": 931,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 934,
"end": 940,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 943,
"end": 950,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 956,
"end": 964,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 956,
"end": 963,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 956,
"end": 957,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 960,
"end": 963,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 969,
"end": 1029,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 976,
"end": 980,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 982,
"end": 1029,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 992,
"end": 1012,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 992,
"end": 1011,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 992,
"end": 993,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 996,
"end": 1011,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "CallExpression",
"span": {
"start": 996,
"end": 1007,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 996,
"end": 1004,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1005,
"end": 1006,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1010,
"end": 1011,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1021,
"end": 1023,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1021,
"end": 1022,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1042,
"end": 1044,
"ctxt": 0
},
"value": "h3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1033,
"end": 1185,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1047,
"end": 1185,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1053,
"end": 1086,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1057,
"end": 1085,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1057,
"end": 1058,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1058,
"end": 1085,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1060,
"end": 1085,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1060,
"end": 1066,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1069,
"end": 1075,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1078,
"end": 1085,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1091,
"end": 1099,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1091,
"end": 1098,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1091,
"end": 1092,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1095,
"end": 1098,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1104,
"end": 1183,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1111,
"end": 1115,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1117,
"end": 1183,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1127,
"end": 1147,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1131,
"end": 1146,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1131,
"end": 1132,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1135,
"end": 1146,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1135,
"end": 1143,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1144,
"end": 1145,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1156,
"end": 1166,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1156,
"end": 1165,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1156,
"end": 1157,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1160,
"end": 1165,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1160,
"end": 1161,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1164,
"end": 1165,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1175,
"end": 1177,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1175,
"end": 1176,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1196,
"end": 1198,
"ctxt": 0
},
"value": "h4",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1187,
"end": 1350,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1201,
"end": 1350,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1207,
"end": 1240,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1211,
"end": 1239,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1211,
"end": 1212,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1212,
"end": 1239,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1214,
"end": 1239,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1214,
"end": 1220,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1223,
"end": 1229,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1232,
"end": 1239,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1245,
"end": 1253,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1245,
"end": 1252,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1245,
"end": 1246,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1249,
"end": 1252,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1258,
"end": 1348,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1265,
"end": 1269,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1271,
"end": 1348,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1281,
"end": 1283,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1281,
"end": 1282,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1292,
"end": 1312,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1296,
"end": 1311,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1296,
"end": 1297,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1300,
"end": 1311,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1300,
"end": 1308,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1309,
"end": 1310,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1321,
"end": 1331,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1321,
"end": 1330,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1321,
"end": 1322,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1325,
"end": 1330,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1325,
"end": 1326,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1329,
"end": 1330,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1340,
"end": 1342,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1340,
"end": 1341,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}