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

314 lines
8.4 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 52,
"end": 234,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 52,
"end": 119,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 58,
"end": 118,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 62,
"end": 118,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 66,
"end": 73,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 75,
"end": 116,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 77,
"end": 84,
"ctxt": 0
},
"value": "resolve",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
"start": 86,
"end": 92,
"ctxt": 0
},
"value": "reject",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 98,
"end": 116,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 100,
"end": 114,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 100,
"end": 113,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 100,
"end": 107,
"ctxt": 0
},
"value": "resolve",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 109,
"end": 111,
"ctxt": 0
},
"properties": []
}
}
],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExportDefaultExpression",
"span": {
"start": 120,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 158,
"end": 178,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"value": "./a",
"raw": "'./a'"
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 180,
"end": 234,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 180,
"end": 233,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 182,
"end": 231,
"ctxt": 0
},
"callee": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 182,
"end": 229,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 199,
"end": 229,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 205,
"end": 227,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 211,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 211,
"end": 216,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 219,
"end": 226,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
"arguments": [],
"typeArguments": null
}
}
}
],
"interpreter": null
}