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

511 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 41,
"end": 277,
"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": 121,
"ctxt": 0
},
"value": "before",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 98,
"end": 130,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 148,
"end": 153,
"ctxt": 0
},
"value": "after",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 131,
"end": 162,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 155,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 157,
"end": 161,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 178,
"end": 182,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 163,
"end": 277,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 200,
"end": 277,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"value": "before",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 220,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 224,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 225,
"end": 242,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 227,
"end": 242,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 229,
"end": 240,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 230,
"end": 239,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 232,
"end": 239,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 248,
"end": 262,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 248,
"end": 261,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 248,
"end": 251,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": "o",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 254,
"end": 261,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 267,
"end": 275,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 267,
"end": 274,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 267,
"end": 272,
"ctxt": 0
},
"value": "after",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 184,
"end": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 186,
"end": 199,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 186,
"end": 193,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 194,
"end": 198,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}