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

426 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 44,
"end": 256,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 44,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 59,
"end": 65,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 67,
"end": 98,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 97,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 97,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 82,
"end": 97,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 89,
"end": 97,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 96,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"value": "before",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 99,
"end": 131,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 149,
"end": 154,
"ctxt": 0
},
"value": "after",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 132,
"end": 163,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 156,
"end": 162,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 179,
"end": 183,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 164,
"end": 256,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 201,
"end": 256,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 207,
"end": 216,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 207,
"end": 215,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 207,
"end": 213,
"ctxt": 0
},
"value": "before",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 221,
"end": 241,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 225,
"end": 240,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 229,
"end": 240,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "AwaitExpression",
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 235,
"end": 236,
"ctxt": 0
},
"value": "p",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 246,
"end": 254,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 246,
"end": 253,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 246,
"end": 251,
"ctxt": 0
},
"value": "after",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 185,
"end": 200,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 187,
"end": 200,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 187,
"end": 194,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 194,
"end": 200,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 195,
"end": 199,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}