swc/crates/swc_ecma_parser/tests/tsc/emitter.forAwait.json

1180 lines
31 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 76,
"end": 1019,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 91,
"end": 93,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 76,
"end": 152,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 96,
"end": 152,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 102,
"end": 113,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 106,
"end": 112,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 107,
"end": 112,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 109,
"end": 112,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 118,
"end": 150,
"ctxt": 0
},
"await": {
"start": 122,
"end": 127,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 143,
"end": 150,
"ctxt": 0
},
"stmts": []
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 191,
"end": 193,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 176,
"end": 254,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 196,
"end": 254,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 202,
"end": 221,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 207,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 209,
"end": 212,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 214,
"end": 220,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 215,
"end": 220,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 217,
"end": 220,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 226,
"end": 252,
"ctxt": 0
},
"await": {
"start": 230,
"end": 235,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 242,
"end": 243,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 245,
"end": 252,
"ctxt": 0
},
"stmts": []
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 294,
"end": 296,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 278,
"end": 355,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 299,
"end": 355,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 305,
"end": 316,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 309,
"end": 315,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 309,
"end": 310,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 310,
"end": 315,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 312,
"end": 315,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 321,
"end": 353,
"ctxt": 0
},
"await": {
"start": 325,
"end": 330,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 332,
"end": 339,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 343,
"end": 344,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 346,
"end": 353,
"ctxt": 0
},
"stmts": []
}
}
]
},
"generator": true,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 395,
"end": 397,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 379,
"end": 458,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 400,
"end": 458,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 406,
"end": 425,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 410,
"end": 416,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 411,
"end": 416,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 413,
"end": 416,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
},
{
"type": "VariableDeclarator",
"span": {
"start": 418,
"end": 424,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 419,
"end": 424,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 430,
"end": 456,
"ctxt": 0
},
"await": {
"start": 434,
"end": 439,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 441,
"end": 442,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 449,
"end": 456,
"ctxt": 0
},
"stmts": []
}
}
]
},
"generator": true,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 553,
"end": 555,
"ctxt": 0
},
"value": "f5",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 538,
"end": 645,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 558,
"end": 645,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 564,
"end": 575,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 568,
"end": 574,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 568,
"end": 569,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 569,
"end": 574,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 571,
"end": 574,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "LabeledStatement",
"span": {
"start": 580,
"end": 643,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 580,
"end": 585,
"ctxt": 0
},
"value": "outer",
"optional": false
},
"body": {
"type": "ForOfStatement",
"span": {
"start": 587,
"end": 643,
"ctxt": 0
},
"await": {
"start": 591,
"end": 596,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 598,
"end": 605,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 604,
"end": 605,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 604,
"end": 605,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 609,
"end": 610,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 612,
"end": 643,
"ctxt": 0
},
"stmts": [
{
"type": "ContinueStatement",
"span": {
"start": 622,
"end": 637,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 631,
"end": 636,
"ctxt": 0
},
"value": "outer",
"optional": false
}
}
]
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 741,
"end": 743,
"ctxt": 0
},
"value": "f6",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 725,
"end": 833,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 746,
"end": 833,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 752,
"end": 763,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 756,
"end": 762,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 756,
"end": 757,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 757,
"end": 762,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 759,
"end": 762,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "LabeledStatement",
"span": {
"start": 768,
"end": 831,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 768,
"end": 773,
"ctxt": 0
},
"value": "outer",
"optional": false
},
"body": {
"type": "ForOfStatement",
"span": {
"start": 775,
"end": 831,
"ctxt": 0
},
"await": {
"start": 779,
"end": 784,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 786,
"end": 793,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 792,
"end": 793,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 792,
"end": 793,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 797,
"end": 798,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 800,
"end": 831,
"ctxt": 0
},
"stmts": [
{
"type": "ContinueStatement",
"span": {
"start": 810,
"end": 825,
"ctxt": 0
},
"label": {
"type": "Identifier",
"span": {
"start": 819,
"end": 824,
"ctxt": 0
},
"value": "outer",
"optional": false
}
}
]
}
}
}
]
},
"generator": true,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 929,
"end": 931,
"ctxt": 0
},
"value": "f7",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 913,
"end": 1019,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 934,
"end": 1019,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 940,
"end": 951,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 944,
"end": 950,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 944,
"end": 945,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 945,
"end": 950,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 947,
"end": 950,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForStatement",
"span": {
"start": 956,
"end": 1017,
"ctxt": 0
},
"init": null,
"test": null,
"update": null,
"body": {
"type": "BlockStatement",
"span": {
"start": 965,
"end": 1017,
"ctxt": 0
},
"stmts": [
{
"type": "ForOfStatement",
"span": {
"start": 975,
"end": 1011,
"ctxt": 0
},
"await": {
"start": 979,
"end": 984,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 986,
"end": 993,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 992,
"end": 993,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 992,
"end": 993,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 997,
"end": 998,
"ctxt": 0
},
"value": "y",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1000,
"end": 1011,
"ctxt": 0
},
"stmts": []
}
}
]
}
}
]
},
"generator": true,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}