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

796 lines
22 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 41,
"end": 417,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 41,
"end": 72,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 53,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 54,
"end": 71,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 56,
"end": 71,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 65,
"end": 71,
"ctxt": 0
},
"kind": "string"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 73,
"end": 130,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 85,
"end": 129,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 86,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 88,
"end": 129,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 88,
"end": 107,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 88,
"end": 99,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 99,
"end": 107,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 100,
"end": 106,
"ctxt": 0
},
"kind": "number"
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 110,
"end": 129,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 110,
"end": 121,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 121,
"end": 129,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 122,
"end": 128,
"ctxt": 0
},
"kind": "string"
}
]
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 131,
"end": 175,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 143,
"end": 174,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 144,
"end": 174,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 146,
"end": 174,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 146,
"end": 157,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 157,
"end": 174,
"ctxt": 0
},
"params": [
{
"type": "TsUnionType",
"span": {
"start": 158,
"end": 173,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 158,
"end": 164,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 167,
"end": 173,
"ctxt": 0
},
"kind": "string"
}
]
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 176,
"end": 220,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 188,
"end": 219,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 189,
"end": 219,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 191,
"end": 219,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 191,
"end": 197,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsTypeReference",
"span": {
"start": 200,
"end": 219,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 200,
"end": 211,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 211,
"end": 219,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 212,
"end": 218,
"ctxt": 0
},
"kind": "string"
}
]
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 221,
"end": 274,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 233,
"end": 273,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 234,
"end": 273,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 236,
"end": 273,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 236,
"end": 242,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsTypeReference",
"span": {
"start": 245,
"end": 273,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 245,
"end": 256,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 256,
"end": 273,
"ctxt": 0
},
"params": [
{
"type": "TsUnionType",
"span": {
"start": 257,
"end": 272,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 257,
"end": 263,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 266,
"end": 272,
"ctxt": 0
},
"kind": "string"
}
]
}
]
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 275,
"end": 417,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 294,
"end": 417,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 297,
"end": 319,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 301,
"end": 318,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 301,
"end": 308,
"ctxt": 0
},
"value": "await_a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 311,
"end": 318,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 321,
"end": 343,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 325,
"end": 342,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 325,
"end": 332,
"ctxt": 0
},
"value": "await_b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 335,
"end": 342,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 345,
"end": 367,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 349,
"end": 366,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 349,
"end": 356,
"ctxt": 0
},
"value": "await_c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 359,
"end": 366,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 365,
"end": 366,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 369,
"end": 391,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 373,
"end": 390,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 373,
"end": 380,
"ctxt": 0
},
"value": "await_d",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 383,
"end": 390,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 393,
"end": 415,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 397,
"end": 414,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 397,
"end": 404,
"ctxt": 0
},
"value": "await_e",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 407,
"end": 414,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 413,
"end": 414,
"ctxt": 0
},
"value": "e",
"optional": false
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}