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

1159 lines
34 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 41,
"end": 571,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 41,
"end": 64,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 53,
"end": 63,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 63,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 65,
"end": 97,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 77,
"end": 96,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 78,
"end": 96,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 80,
"end": 96,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 80,
"end": 87,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 87,
"end": 96,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 88,
"end": 95,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 115,
"end": 117,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 118,
"end": 131,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 118,
"end": 131,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 122,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 124,
"end": 131,
"ctxt": 0
},
"kind": "boolean"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 133,
"end": 146,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 133,
"end": 146,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 137,
"end": 146,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 139,
"end": 146,
"ctxt": 0
},
"kind": "boolean"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 148,
"end": 161,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 148,
"end": 161,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 161,
"ctxt": 0
},
"kind": "boolean"
}
}
}
}
],
"decorators": [],
"span": {
"start": 98,
"end": 169,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 168,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 170,
"end": 244,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 182,
"end": 243,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 183,
"end": 243,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 185,
"end": 243,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 187,
"end": 241,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 187,
"end": 189,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 190,
"end": 203,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 194,
"end": 203,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 203,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 205,
"end": 218,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 209,
"end": 218,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 211,
"end": 218,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 220,
"end": 233,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 226,
"end": 233,
"ctxt": 0
},
"kind": "boolean"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 234,
"end": 240,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 236,
"end": 240,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 245,
"end": 328,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 257,
"end": 327,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 257,
"end": 260,
"ctxt": 0
},
"value": "pfn",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 260,
"end": 327,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 262,
"end": 327,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 269,
"end": 327,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 270,
"end": 326,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 272,
"end": 324,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 273,
"end": 286,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 277,
"end": 286,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 279,
"end": 286,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 288,
"end": 301,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 292,
"end": 301,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 294,
"end": 301,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 303,
"end": 316,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 307,
"end": 316,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 309,
"end": 316,
"ctxt": 0
},
"kind": "boolean"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 317,
"end": 323,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 319,
"end": 323,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 329,
"end": 413,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 341,
"end": 412,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 341,
"end": 343,
"ctxt": 0
},
"value": "po",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 343,
"end": 412,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 345,
"end": 412,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 352,
"end": 412,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 353,
"end": 411,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 355,
"end": 409,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 355,
"end": 357,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 358,
"end": 371,
"ctxt": 0
},
"value": "arg0",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 362,
"end": 371,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 364,
"end": 371,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 373,
"end": 386,
"ctxt": 0
},
"value": "arg1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 377,
"end": 386,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 379,
"end": 386,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "Identifier",
"span": {
"start": 388,
"end": 401,
"ctxt": 0
},
"value": "arg2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 392,
"end": 401,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 394,
"end": 401,
"ctxt": 0
},
"kind": "boolean"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 402,
"end": 408,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 404,
"end": 408,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 431,
"end": 437,
"ctxt": 0
},
"value": "before",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 414,
"end": 446,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 439,
"end": 445,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 441,
"end": 445,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 464,
"end": 469,
"ctxt": 0
},
"value": "after",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 447,
"end": 478,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 471,
"end": 477,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 473,
"end": 477,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 494,
"end": 498,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 479,
"end": 571,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 516,
"end": 571,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 522,
"end": 531,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 522,
"end": 530,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 522,
"end": 528,
"ctxt": 0
},
"value": "before",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 536,
"end": 556,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 540,
"end": 555,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 540,
"end": 541,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 544,
"end": 555,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 544,
"end": 546,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 547,
"end": 548,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 550,
"end": 551,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 553,
"end": 554,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 561,
"end": 569,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 561,
"end": 568,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 561,
"end": 566,
"ctxt": 0
},
"value": "after",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 500,
"end": 515,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 502,
"end": 515,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 502,
"end": 509,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 509,
"end": 515,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 510,
"end": 514,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}