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

796 lines
22 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 68,
"end": 444,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 68,
"end": 99,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 80,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 81,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 83,
"end": 98,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 83,
"end": 89,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"kind": "string"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 100,
"end": 157,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 112,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 113,
"end": 156,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 115,
"end": 156,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 115,
"end": 134,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 115,
"end": 126,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 126,
"end": 134,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 133,
"ctxt": 0
},
"kind": "number"
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 137,
"end": 156,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 137,
"end": 148,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 148,
"end": 156,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 149,
"end": 155,
"ctxt": 0
},
"kind": "string"
}
]
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 158,
"end": 202,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 170,
"end": 201,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 171,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 173,
"end": 201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 173,
"end": 184,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 184,
"end": 201,
"ctxt": 0
},
"params": [
{
"type": "TsUnionType",
"span": {
"start": 185,
"end": 200,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 185,
"end": 191,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 194,
"end": 200,
"ctxt": 0
},
"kind": "string"
}
]
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 203,
"end": 247,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 215,
"end": 246,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 216,
"end": 246,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 218,
"end": 246,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 218,
"end": 224,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsTypeReference",
"span": {
"start": 227,
"end": 246,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 227,
"end": 238,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 238,
"end": 246,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 239,
"end": 245,
"ctxt": 0
},
"kind": "string"
}
]
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 248,
"end": 301,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 260,
"end": 300,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 261,
"end": 300,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 263,
"end": 300,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 263,
"end": 269,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsTypeReference",
"span": {
"start": 272,
"end": 300,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 272,
"end": 283,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 283,
"end": 300,
"ctxt": 0
},
"params": [
{
"type": "TsUnionType",
"span": {
"start": 284,
"end": 299,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 284,
"end": 290,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 293,
"end": 299,
"ctxt": 0
},
"kind": "string"
}
]
}
]
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 302,
"end": 444,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 321,
"end": 444,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 324,
"end": 346,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 328,
"end": 345,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 328,
"end": 335,
"ctxt": 0
},
"value": "await_a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 338,
"end": 345,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 348,
"end": 370,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 352,
"end": 369,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 352,
"end": 359,
"ctxt": 0
},
"value": "await_b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 362,
"end": 369,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 368,
"end": 369,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 372,
"end": 394,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 376,
"end": 393,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 376,
"end": 383,
"ctxt": 0
},
"value": "await_c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 386,
"end": 393,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 392,
"end": 393,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 396,
"end": 418,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 400,
"end": 417,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 400,
"end": 407,
"ctxt": 0
},
"value": "await_d",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 410,
"end": 417,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 420,
"end": 442,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 424,
"end": 441,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 424,
"end": 431,
"ctxt": 0
},
"value": "await_e",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 434,
"end": 441,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 440,
"end": 441,
"ctxt": 0
},
"value": "e",
"optional": false
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}