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

4361 lines
124 KiB
JSON

{
"type": "Script",
"span": {
"start": 52,
"end": 2384,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 52,
"end": 70,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 56,
"end": 69,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 56,
"end": 60,
"ctxt": 0
},
"value": "cond",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 60,
"end": 69,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 62,
"end": 69,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 87,
"end": 90,
"ctxt": 0
},
"value": "len",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 92,
"end": 100,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 72,
"end": 126,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 102,
"end": 126,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 108,
"end": 124,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 115,
"end": 123,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 143,
"end": 145,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 128,
"end": 270,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 148,
"end": 270,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 154,
"end": 187,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 158,
"end": 186,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 159,
"end": 186,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 161,
"end": 186,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 170,
"end": 176,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 179,
"end": 186,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 192,
"end": 199,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 196,
"end": 198,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 204,
"end": 261,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 211,
"end": 215,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 217,
"end": 261,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 227,
"end": 244,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 227,
"end": 243,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 231,
"end": 243,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 237,
"end": 243,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"value": "len",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 253,
"end": 255,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 253,
"end": 254,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 266,
"end": 268,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 287,
"end": 289,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 272,
"end": 414,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 292,
"end": 414,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 298,
"end": 331,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 302,
"end": 330,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 302,
"end": 303,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 303,
"end": 330,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 305,
"end": 330,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 314,
"end": 320,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 323,
"end": 330,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 336,
"end": 343,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 336,
"end": 342,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 348,
"end": 405,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 355,
"end": 359,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 361,
"end": 405,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 371,
"end": 373,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 371,
"end": 372,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 382,
"end": 399,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 382,
"end": 398,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 382,
"end": 383,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 386,
"end": 398,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 392,
"end": 398,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 392,
"end": 395,
"ctxt": 0
},
"value": "len",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 396,
"end": 397,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 410,
"end": 412,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 437,
"end": 446,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 437,
"end": 446,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 438,
"end": 446,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 440,
"end": 446,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 416,
"end": 465,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 447,
"end": 464,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 449,
"end": 464,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 449,
"end": 456,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 456,
"end": 464,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 457,
"end": 463,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 483,
"end": 486,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 487,
"end": 496,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 487,
"end": 496,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 488,
"end": 496,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 490,
"end": 496,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 466,
"end": 515,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 497,
"end": 514,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 499,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 499,
"end": 506,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 506,
"end": 514,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 507,
"end": 513,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 532,
"end": 534,
"ctxt": 0
},
"value": "g1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 517,
"end": 659,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 537,
"end": 659,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 543,
"end": 576,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 547,
"end": 575,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 547,
"end": 548,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 548,
"end": 575,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 550,
"end": 575,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 550,
"end": 556,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 559,
"end": 565,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 568,
"end": 575,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 581,
"end": 588,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 581,
"end": 587,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 581,
"end": 582,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 585,
"end": 587,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 593,
"end": 650,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 600,
"end": 604,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 606,
"end": 650,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 616,
"end": 633,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 616,
"end": 632,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 616,
"end": 617,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 620,
"end": 632,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 626,
"end": 632,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 626,
"end": 629,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 630,
"end": 631,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 642,
"end": 644,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 642,
"end": 643,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 655,
"end": 657,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 655,
"end": 656,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 676,
"end": 678,
"ctxt": 0
},
"value": "g2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 661,
"end": 803,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 681,
"end": 803,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 687,
"end": 720,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 691,
"end": 719,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 691,
"end": 692,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 692,
"end": 719,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 694,
"end": 719,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 694,
"end": 700,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 703,
"end": 709,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 712,
"end": 719,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 725,
"end": 732,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 725,
"end": 731,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 725,
"end": 726,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 729,
"end": 731,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 737,
"end": 794,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 744,
"end": 748,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 750,
"end": 794,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 760,
"end": 762,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 760,
"end": 761,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 771,
"end": 788,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 771,
"end": 787,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 771,
"end": 772,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 775,
"end": 787,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 781,
"end": 787,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 781,
"end": 784,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 785,
"end": 786,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 799,
"end": 801,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 799,
"end": 800,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 820,
"end": 828,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 829,
"end": 847,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 829,
"end": 847,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 830,
"end": 847,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 832,
"end": 847,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 832,
"end": 838,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 841,
"end": 847,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 805,
"end": 884,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 866,
"end": 884,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 872,
"end": 882,
"ctxt": 0
},
"argument": {
"type": "UnaryExpression",
"span": {
"start": 879,
"end": 881,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 880,
"end": 881,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 848,
"end": 865,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 850,
"end": 865,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 850,
"end": 857,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 857,
"end": 865,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 858,
"end": 864,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 901,
"end": 903,
"ctxt": 0
},
"value": "h1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 886,
"end": 1016,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 906,
"end": 1016,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 912,
"end": 945,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 916,
"end": 944,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 916,
"end": 917,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 917,
"end": 944,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 919,
"end": 944,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 919,
"end": 925,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 928,
"end": 934,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 937,
"end": 944,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 950,
"end": 958,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 950,
"end": 957,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 950,
"end": 951,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 954,
"end": 957,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 963,
"end": 1014,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 970,
"end": 974,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 976,
"end": 1014,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 986,
"end": 997,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 986,
"end": 996,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 986,
"end": 987,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 990,
"end": 996,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "UnaryExpression",
"span": {
"start": 990,
"end": 992,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 991,
"end": 992,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 995,
"end": 996,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1006,
"end": 1008,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1006,
"end": 1007,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1033,
"end": 1035,
"ctxt": 0
},
"value": "h2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1018,
"end": 1163,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1038,
"end": 1163,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1044,
"end": 1077,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1048,
"end": 1076,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1048,
"end": 1049,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1049,
"end": 1076,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1051,
"end": 1076,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1051,
"end": 1057,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1060,
"end": 1066,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1069,
"end": 1076,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1082,
"end": 1090,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1082,
"end": 1089,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1082,
"end": 1083,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1086,
"end": 1089,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1095,
"end": 1161,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1102,
"end": 1106,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1108,
"end": 1161,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1118,
"end": 1144,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1118,
"end": 1143,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1118,
"end": 1119,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1122,
"end": 1143,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "AwaitExpression",
"span": {
"start": 1122,
"end": 1139,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 1128,
"end": 1139,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1128,
"end": 1136,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1137,
"end": 1138,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1142,
"end": 1143,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1153,
"end": 1155,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1153,
"end": 1154,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1180,
"end": 1182,
"ctxt": 0
},
"value": "h3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1165,
"end": 1329,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1185,
"end": 1329,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1191,
"end": 1224,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1195,
"end": 1223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1195,
"end": 1196,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1196,
"end": 1223,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1198,
"end": 1223,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1198,
"end": 1204,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1207,
"end": 1213,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1216,
"end": 1223,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1229,
"end": 1237,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1229,
"end": 1236,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1229,
"end": 1230,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1233,
"end": 1236,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1242,
"end": 1327,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1249,
"end": 1253,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1255,
"end": 1327,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1265,
"end": 1291,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1269,
"end": 1290,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1269,
"end": 1270,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 1273,
"end": 1290,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 1279,
"end": 1290,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1279,
"end": 1287,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1288,
"end": 1289,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1300,
"end": 1310,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1300,
"end": 1309,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1300,
"end": 1301,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1304,
"end": 1309,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1304,
"end": 1305,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1308,
"end": 1309,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1319,
"end": 1321,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1319,
"end": 1320,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1346,
"end": 1348,
"ctxt": 0
},
"value": "h4",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1331,
"end": 1506,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1351,
"end": 1506,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1357,
"end": 1390,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1361,
"end": 1389,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1361,
"end": 1362,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1362,
"end": 1389,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1364,
"end": 1389,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1364,
"end": 1370,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1373,
"end": 1379,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1382,
"end": 1389,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1395,
"end": 1403,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1395,
"end": 1402,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1395,
"end": 1396,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1399,
"end": 1402,
"ctxt": 0
},
"value": "0",
"raw": "\"0\""
}
}
},
{
"type": "WhileStatement",
"span": {
"start": 1408,
"end": 1504,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 1415,
"end": 1419,
"ctxt": 0
},
"value": "cond",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1421,
"end": 1504,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1431,
"end": 1433,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1431,
"end": 1432,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1442,
"end": 1468,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1446,
"end": 1467,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1446,
"end": 1447,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 1450,
"end": 1467,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 1456,
"end": 1467,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1456,
"end": 1464,
"ctxt": 0
},
"value": "asNumber",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1465,
"end": 1466,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1477,
"end": 1487,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1477,
"end": 1486,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1477,
"end": 1478,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 1481,
"end": 1486,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 1481,
"end": 1482,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1485,
"end": 1486,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1496,
"end": 1498,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1496,
"end": 1497,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1540,
"end": 1550,
"ctxt": 0
},
"value": "get_things",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 1551,
"end": 1572,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1551,
"end": 1572,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1552,
"end": 1572,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1554,
"end": 1572,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1554,
"end": 1560,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1563,
"end": 1572,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1525,
"end": 1593,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1574,
"end": 1593,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 1580,
"end": 1591,
"ctxt": 0
},
"argument": {
"type": "ArrayExpression",
"span": {
"start": 1587,
"end": 1590,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 1588,
"end": 1589,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1610,
"end": 1616,
"ctxt": 0
},
"value": "foobar",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1595,
"end": 1789,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1619,
"end": 1789,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1625,
"end": 1668,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1629,
"end": 1667,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1629,
"end": 1635,
"ctxt": 0
},
"value": "before",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1635,
"end": 1655,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1637,
"end": 1655,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1637,
"end": 1643,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 1646,
"end": 1655,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 1658,
"end": 1667,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"definite": false
}
]
},
{
"type": "ForStatement",
"span": {
"start": 1673,
"end": 1787,
"ctxt": 0
},
"init": {
"type": "VariableDeclaration",
"span": {
"start": 1678,
"end": 1687,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1682,
"end": 1687,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1682,
"end": 1683,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 1686,
"end": 1687,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"definite": false
}
]
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 1689,
"end": 1694,
"ctxt": 0
},
"operator": "<",
"left": {
"type": "Identifier",
"span": {
"start": 1689,
"end": 1690,
"ctxt": 0
},
"value": "i",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1693,
"end": 1694,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
"update": {
"type": "UpdateExpression",
"span": {
"start": 1696,
"end": 1699,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "Identifier",
"span": {
"start": 1696,
"end": 1697,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1701,
"end": 1787,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1711,
"end": 1752,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1717,
"end": 1751,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1717,
"end": 1724,
"ctxt": 0
},
"value": "results",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 1727,
"end": 1751,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 1733,
"end": 1751,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1733,
"end": 1743,
"ctxt": 0
},
"value": "get_things",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1744,
"end": 1750,
"ctxt": 0
},
"value": "before",
"optional": false
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1761,
"end": 1781,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1761,
"end": 1780,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1761,
"end": 1767,
"ctxt": 0
},
"value": "before",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 1770,
"end": 1780,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1770,
"end": 1777,
"ctxt": 0
},
"value": "results",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 1777,
"end": 1780,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 1778,
"end": 1779,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
}
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1848,
"end": 1852,
"ctxt": 0
},
"value": "foox",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1853,
"end": 1874,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1853,
"end": 1874,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1854,
"end": 1874,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1856,
"end": 1874,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1856,
"end": 1862,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1865,
"end": 1874,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1831,
"end": 1892,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1875,
"end": 1892,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1877,
"end": 1892,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1877,
"end": 1884,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1884,
"end": 1892,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 1885,
"end": 1891,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1894,
"end": 2022,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 1894,
"end": 2022,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 1906,
"end": 2022,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1910,
"end": 1950,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1914,
"end": 1949,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1914,
"end": 1917,
"ctxt": 0
},
"value": "bar",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1917,
"end": 1937,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1919,
"end": 1937,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 1919,
"end": 1925,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 1928,
"end": 1937,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 1940,
"end": 1949,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"definite": false
}
]
},
{
"type": "DoWhileStatement",
"span": {
"start": 1953,
"end": 2020,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 2016,
"end": 2019,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1956,
"end": 2008,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1962,
"end": 1990,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1968,
"end": 1989,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1968,
"end": 1971,
"ctxt": 0
},
"value": "baz",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 1974,
"end": 1989,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 1980,
"end": 1989,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1980,
"end": 1984,
"ctxt": 0
},
"value": "foox",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1985,
"end": 1988,
"ctxt": 0
},
"value": "bar",
"optional": false
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1995,
"end": 2004,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1995,
"end": 2004,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1995,
"end": 1998,
"ctxt": 0
},
"value": "bar",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 2001,
"end": 2004,
"ctxt": 0
},
"value": "baz",
"optional": false
}
}
}
]
}
}
]
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2081,
"end": 2088,
"ctxt": 0
},
"value": "myQuery",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 2089,
"end": 2126,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 2089,
"end": 2126,
"ctxt": 0
},
"value": "input",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2094,
"end": 2126,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 2096,
"end": 2126,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 2098,
"end": 2124,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 2098,
"end": 2104,
"ctxt": 0
},
"value": "lastId",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2104,
"end": 2124,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 2106,
"end": 2124,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 2106,
"end": 2112,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 2115,
"end": 2124,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 2064,
"end": 2161,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2127,
"end": 2160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2129,
"end": 2160,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2129,
"end": 2136,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2136,
"end": 2160,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 2137,
"end": 2159,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 2139,
"end": 2157,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 2139,
"end": 2147,
"ctxt": 0
},
"value": "entities",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2147,
"end": 2157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 2149,
"end": 2157,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 2149,
"end": 2155,
"ctxt": 0
},
"kind": "number"
}
}
},
"typeParams": null
}
]
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2178,
"end": 2184,
"ctxt": 0
},
"value": "myFunc",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 2163,
"end": 2384,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 2202,
"end": 2384,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 2206,
"end": 2249,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2210,
"end": 2248,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2210,
"end": 2216,
"ctxt": 0
},
"value": "lastId",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2216,
"end": 2236,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 2218,
"end": 2236,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 2218,
"end": 2224,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 2227,
"end": 2236,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 2239,
"end": 2248,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"definite": false
}
]
},
{
"type": "WhileStatement",
"span": {
"start": 2253,
"end": 2381,
"ctxt": 0
},
"test": {
"type": "BooleanLiteral",
"span": {
"start": 2260,
"end": 2264,
"ctxt": 0
},
"value": true
},
"body": {
"type": "BlockStatement",
"span": {
"start": 2266,
"end": 2381,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 2272,
"end": 2332,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2278,
"end": 2331,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 2278,
"end": 2290,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 2280,
"end": 2288,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 2280,
"end": 2288,
"ctxt": 0
},
"value": "entities",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 2293,
"end": 2331,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 2299,
"end": 2331,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 2299,
"end": 2306,
"ctxt": 0
},
"value": "myQuery",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 2307,
"end": 2330,
"ctxt": 0
},
"properties": [
{
"type": "Identifier",
"span": {
"start": 2317,
"end": 2323,
"ctxt": 0
},
"value": "lastId",
"optional": false
}
]
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 2338,
"end": 2377,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 2338,
"end": 2376,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 2338,
"end": 2344,
"ctxt": 0
},
"value": "lastId",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 2347,
"end": 2376,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2347,
"end": 2355,
"ctxt": 0
},
"value": "entities",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 2355,
"end": 2376,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 2356,
"end": 2375,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "MemberExpression",
"span": {
"start": 2356,
"end": 2371,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2356,
"end": 2364,
"ctxt": 0
},
"value": "entities",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2365,
"end": 2371,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 2374,
"end": 2375,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
}
}
}
]
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2186,
"end": 2201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2188,
"end": 2201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2188,
"end": 2195,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2195,
"end": 2201,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2196,
"end": 2200,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}