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

1193 lines
35 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 40,
"end": 581,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 40,
"end": 63,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 52,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 62,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 64,
"end": 96,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 76,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 79,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 79,
"end": 86,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 86,
"end": 95,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 87,
"end": 94,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 114,
"end": 116,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 117,
"end": 130,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 117,
"end": 130,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 123,
"end": 130,
"ctxt": 0
},
"kind": "boolean"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 132,
"end": 145,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 132,
"end": 145,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 145,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 138,
"end": 145,
"ctxt": 0
},
"kind": "boolean"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 147,
"end": 160,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 147,
"end": 160,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"kind": "boolean"
}
}
}
}
],
"decorators": [],
"span": {
"start": 97,
"end": 168,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 163,
"end": 167,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 169,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 181,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 182,
"end": 242,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 184,
"end": 242,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 186,
"end": 240,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 186,
"end": 188,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 189,
"end": 202,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 193,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 195,
"end": 202,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 204,
"end": 217,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 210,
"end": 217,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 219,
"end": 232,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 223,
"end": 232,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 225,
"end": 232,
"ctxt": 0
},
"kind": "boolean"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 233,
"end": 239,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 244,
"end": 327,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 256,
"end": 326,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 256,
"end": 259,
"ctxt": 0
},
"value": "pfn",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 259,
"end": 326,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 261,
"end": 326,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 261,
"end": 268,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 268,
"end": 326,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 269,
"end": 325,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 271,
"end": 323,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 272,
"end": 285,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 276,
"end": 285,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 278,
"end": 285,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 287,
"end": 300,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 291,
"end": 300,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 302,
"end": 315,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 306,
"end": 315,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 308,
"end": 315,
"ctxt": 0
},
"kind": "boolean"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 316,
"end": 322,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 318,
"end": 322,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 328,
"end": 412,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 340,
"end": 411,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": "po",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 342,
"end": 411,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 344,
"end": 411,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 344,
"end": 351,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 351,
"end": 411,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 352,
"end": 410,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 354,
"end": 408,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 357,
"end": 370,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 361,
"end": 370,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 363,
"end": 370,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 372,
"end": 385,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 376,
"end": 385,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 378,
"end": 385,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 387,
"end": 400,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 391,
"end": 400,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 393,
"end": 400,
"ctxt": 0
},
"kind": "boolean"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 401,
"end": 407,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 403,
"end": 407,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 430,
"end": 436,
"ctxt": 0
},
"value": "before",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 413,
"end": 445,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 438,
"end": 444,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 440,
"end": 444,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 463,
"end": 468,
"ctxt": 0
},
"value": "after",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 446,
"end": 477,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 470,
"end": 476,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 472,
"end": 476,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 493,
"end": 497,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 478,
"end": 581,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 515,
"end": 581,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 521,
"end": 530,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 521,
"end": 529,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 521,
"end": 527,
"ctxt": 0
},
"value": "before",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 535,
"end": 566,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 539,
"end": 565,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 539,
"end": 540,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 543,
"end": 565,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 543,
"end": 556,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 543,
"end": 553,
"ctxt": 0
},
"expression": {
"type": "AwaitExpression",
"span": {
"start": 544,
"end": 552,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 550,
"end": 552,
"ctxt": 0
},
"value": "po",
"optional": false
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 554,
"end": 556,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 557,
"end": 558,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 571,
"end": 579,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 571,
"end": 578,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 571,
"end": 576,
"ctxt": 0
},
"value": "after",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 499,
"end": 514,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 501,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 501,
"end": 508,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 508,
"end": 514,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 509,
"end": 513,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}