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

511 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 68,
"end": 304,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 68,
"end": 91,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 80,
"end": 90,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 81,
"end": 90,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 83,
"end": 90,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 92,
"end": 124,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 104,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 123,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 107,
"end": 123,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 107,
"end": 114,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 114,
"end": 123,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 115,
"end": 122,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 142,
"end": 148,
"ctxt": 0
},
"value": "before",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 125,
"end": 157,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 150,
"end": 156,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 152,
"end": 156,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 175,
"end": 180,
"ctxt": 0
},
"value": "after",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 158,
"end": 189,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 182,
"end": 188,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 205,
"end": 209,
"ctxt": 0
},
"value": "func",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 190,
"end": 304,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 227,
"end": 304,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 233,
"end": 241,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 233,
"end": 239,
"ctxt": 0
},
"value": "before",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 247,
"end": 270,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 251,
"end": 269,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 251,
"end": 252,
"ctxt": 0
},
"value": "o",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 252,
"end": 269,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 254,
"end": 269,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 256,
"end": 267,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 257,
"end": 266,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 259,
"end": 266,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 275,
"end": 289,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 275,
"end": 288,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 275,
"end": 278,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "o",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 281,
"end": 288,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 294,
"end": 302,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 294,
"end": 301,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 294,
"end": 299,
"ctxt": 0
},
"value": "after",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 211,
"end": 226,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 213,
"end": 226,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 213,
"end": 220,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 220,
"end": 226,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 221,
"end": 225,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}