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

511 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 40,
"end": 276,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 40,
"end": 63,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 52,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 62,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 64,
"end": 96,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 76,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 79,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 79,
"end": 86,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 86,
"end": 95,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 87,
"end": 94,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 114,
"end": 120,
"ctxt": 0
},
"value": "before",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 97,
"end": 129,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 122,
"end": 128,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 124,
"end": 128,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 147,
"end": 152,
"ctxt": 0
},
"value": "after",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 130,
"end": 161,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 156,
"end": 160,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 177,
"end": 181,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 162,
"end": 276,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 199,
"end": 276,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 205,
"end": 214,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 205,
"end": 213,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 205,
"end": 211,
"ctxt": 0
},
"value": "before",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 219,
"end": 242,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 223,
"end": 241,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 224,
"end": 241,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 226,
"end": 241,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 228,
"end": 239,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 229,
"end": 238,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 231,
"end": 238,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 247,
"end": 261,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 247,
"end": 260,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 247,
"end": 250,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "o",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 253,
"end": 260,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 266,
"end": 274,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 266,
"end": 273,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 266,
"end": 271,
"ctxt": 0
},
"value": "after",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 183,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 185,
"end": 198,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 185,
"end": 192,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 193,
"end": 197,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}