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

314 lines
8.4 KiB
JSON

{
"type": "Module",
"span": {
"start": 57,
"end": 239,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 57,
"end": 124,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 63,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 67,
"end": 123,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 71,
"end": 78,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 80,
"end": 121,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "resolve",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 91,
"end": 97,
"ctxt": 0
},
"value": "reject",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 103,
"end": 121,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 105,
"end": 119,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 105,
"end": 118,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 105,
"end": 112,
"ctxt": 0
},
"value": "resolve",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 114,
"end": 116,
"ctxt": 0
},
"properties": []
}
}
],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExportDefaultExpression",
"span": {
"start": 125,
"end": 142,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 163,
"end": 183,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 177,
"end": 182,
"ctxt": 0
},
"value": "./a",
"raw": "'./a'"
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 185,
"end": 239,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 185,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 187,
"end": 236,
"ctxt": 0
},
"callee": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 187,
"end": 234,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 204,
"end": 234,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 210,
"end": 232,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 216,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 216,
"end": 221,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 224,
"end": 231,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
"arguments": [],
"typeArguments": null
}
}
}
],
"interpreter": null
}