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

2069 lines
60 KiB
JSON

{
"type": "Script",
"span": {
"start": 48,
"end": 1247,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 65,
"end": 82,
"ctxt": 0
},
"value": "getStringOrNumber",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 48,
"end": 102,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 84,
"end": 101,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 86,
"end": 101,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 86,
"end": 92,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 113,
"end": 115,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 104,
"end": 264,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 118,
"end": 264,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 124,
"end": 152,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 128,
"end": 151,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 132,
"end": 151,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 132,
"end": 149,
"ctxt": 0
},
"value": "getStringOrNumber",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 157,
"end": 262,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 161,
"end": 182,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "UnaryExpression",
"span": {
"start": 161,
"end": 169,
"ctxt": 0
},
"operator": "typeof",
"argument": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 174,
"end": 182,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 184,
"end": 262,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 194,
"end": 256,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 255,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 202,
"end": 255,
"ctxt": 0
},
"callee": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 202,
"end": 253,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 213,
"end": 253,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 227,
"end": 243,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 234,
"end": 242,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 234,
"end": 235,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 236,
"end": 242,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 275,
"end": 277,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 266,
"end": 428,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 280,
"end": 428,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 286,
"end": 314,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 290,
"end": 313,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 294,
"end": 313,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 294,
"end": 311,
"ctxt": 0
},
"value": "getStringOrNumber",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 319,
"end": 426,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 323,
"end": 344,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "UnaryExpression",
"span": {
"start": 323,
"end": 331,
"ctxt": 0
},
"operator": "typeof",
"argument": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 336,
"end": 344,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 346,
"end": 426,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 356,
"end": 420,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 360,
"end": 419,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 364,
"end": 419,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 364,
"end": 417,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 365,
"end": 416,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 376,
"end": 416,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 390,
"end": 406,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 397,
"end": 405,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 397,
"end": 398,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 399,
"end": 405,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 439,
"end": 441,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 430,
"end": 586,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 444,
"end": 586,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 450,
"end": 478,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 454,
"end": 477,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 454,
"end": 455,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 458,
"end": 477,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 458,
"end": 475,
"ctxt": 0
},
"value": "getStringOrNumber",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 483,
"end": 497,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 487,
"end": 496,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 487,
"end": 488,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 488,
"end": 496,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 490,
"end": 496,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 502,
"end": 584,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 506,
"end": 527,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "UnaryExpression",
"span": {
"start": 506,
"end": 514,
"ctxt": 0
},
"operator": "typeof",
"argument": {
"type": "Identifier",
"span": {
"start": 513,
"end": 514,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 519,
"end": 527,
"ctxt": 0
},
"value": "string",
"raw": "\"string\""
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 529,
"end": 584,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 539,
"end": 578,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 543,
"end": 577,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 547,
"end": 577,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 547,
"end": 570,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 548,
"end": 569,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 548,
"end": 549,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BinaryExpression",
"span": {
"start": 553,
"end": 569,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 553,
"end": 565,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 553,
"end": 561,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 553,
"end": 554,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 555,
"end": 561,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 568,
"end": 569,
"ctxt": 0
},
"value": "z",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 571,
"end": 576,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 571,
"end": 572,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 575,
"end": 576,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 610,
"end": 646,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 614,
"end": 645,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 614,
"end": 625,
"ctxt": 0
},
"value": "maybeNumber",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 625,
"end": 645,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 627,
"end": 645,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 627,
"end": 633,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 636,
"end": 645,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 647,
"end": 688,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 647,
"end": 687,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 647,
"end": 685,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 648,
"end": 684,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 660,
"end": 684,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 666,
"end": 682,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 666,
"end": 681,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 666,
"end": 677,
"ctxt": 0
},
"value": "maybeNumber",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 680,
"end": 681,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 689,
"end": 703,
"ctxt": 0
},
"expression": {
"type": "UpdateExpression",
"span": {
"start": 689,
"end": 702,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "Identifier",
"span": {
"start": 689,
"end": 700,
"ctxt": 0
},
"value": "maybeNumber",
"optional": false
}
}
},
{
"type": "IfStatement",
"span": {
"start": 704,
"end": 757,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 708,
"end": 733,
"ctxt": 0
},
"operator": "!==",
"left": {
"type": "Identifier",
"span": {
"start": 708,
"end": 719,
"ctxt": 0
},
"value": "maybeNumber",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 724,
"end": 733,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 735,
"end": 757,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 741,
"end": 755,
"ctxt": 0
},
"expression": {
"type": "UpdateExpression",
"span": {
"start": 741,
"end": 754,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "Identifier",
"span": {
"start": 741,
"end": 752,
"ctxt": 0
},
"value": "maybeNumber",
"optional": false
}
}
}
]
},
"alternate": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 759,
"end": 788,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 763,
"end": 787,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 763,
"end": 767,
"ctxt": 0
},
"value": "test",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 767,
"end": 787,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 769,
"end": 787,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 769,
"end": 775,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 778,
"end": 787,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 789,
"end": 847,
"ctxt": 0
},
"test": {
"type": "UnaryExpression",
"span": {
"start": 793,
"end": 798,
"ctxt": 0
},
"operator": "!",
"argument": {
"type": "Identifier",
"span": {
"start": 794,
"end": 798,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 800,
"end": 847,
"ctxt": 0
},
"stmts": [
{
"type": "ThrowStatement",
"span": {
"start": 806,
"end": 845,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 812,
"end": 844,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 816,
"end": 821,
"ctxt": 0
},
"value": "Error",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 822,
"end": 843,
"ctxt": 0
},
"value": "Test is not defined",
"raw": "'Test is not defined'"
}
}
],
"typeArguments": null
}
}
]
},
"alternate": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 848,
"end": 893,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 848,
"end": 892,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 848,
"end": 890,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 849,
"end": 889,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 855,
"end": 889,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 861,
"end": 875,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 861,
"end": 874,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 861,
"end": 871,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 861,
"end": 865,
"ctxt": 0
},
"value": "test",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 866,
"end": 871,
"ctxt": 0
},
"value": "slice",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 926,
"end": 928,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 917,
"end": 1003,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 931,
"end": 1003,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 937,
"end": 951,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 941,
"end": 950,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 941,
"end": 942,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 942,
"end": 950,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 944,
"end": 950,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 956,
"end": 994,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 956,
"end": 993,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 956,
"end": 991,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 957,
"end": 990,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 968,
"end": 990,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 978,
"end": 984,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 978,
"end": 983,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 978,
"end": 979,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 982,
"end": 983,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 999,
"end": 1001,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 999,
"end": 1000,
"ctxt": 0
},
"value": "v",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1014,
"end": 1016,
"ctxt": 0
},
"value": "f5",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1005,
"end": 1128,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1019,
"end": 1128,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1025,
"end": 1039,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1029,
"end": 1038,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1029,
"end": 1030,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1030,
"end": 1038,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1032,
"end": 1038,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1044,
"end": 1100,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1044,
"end": 1099,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 1044,
"end": 1097,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 1045,
"end": 1096,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1057,
"end": 1096,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1067,
"end": 1075,
"ctxt": 0
},
"expression": {
"type": "YieldExpression",
"span": {
"start": 1067,
"end": 1074,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 1073,
"end": 1074,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"delegate": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1084,
"end": 1090,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1084,
"end": 1089,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1084,
"end": 1085,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 1088,
"end": 1089,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": true,
"async": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1105,
"end": 1107,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1105,
"end": 1106,
"ctxt": 0
},
"value": "v",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1139,
"end": 1141,
"ctxt": 0
},
"value": "f6",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 1130,
"end": 1247,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1144,
"end": 1247,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1150,
"end": 1164,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1154,
"end": 1163,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1154,
"end": 1155,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1155,
"end": 1163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1157,
"end": 1163,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1169,
"end": 1219,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1169,
"end": 1218,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 1169,
"end": 1216,
"ctxt": 0
},
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 1170,
"end": 1215,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1187,
"end": 1215,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1197,
"end": 1209,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1197,
"end": 1208,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 1197,
"end": 1198,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 1201,
"end": 1208,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 1207,
"end": 1208,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1224,
"end": 1226,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1224,
"end": 1225,
"ctxt": 0
},
"value": "v",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}