swc/crates/swc_ecma_parser/tests/tsc/exportAssignmentTopLevelIdentifier.json
Donny/강동윤 3958f1792c
refactor(es/ast): Remove unused fields (#7518)
**Related issue:**

 - Closes #7347.
 - Closes #7487.
2023-06-12 08:02:34 +00:00

213 lines
4.5 KiB
JSON

{
"type": "Module",
"span": {
"start": 40,
"end": 176,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 40,
"end": 79,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 51,
"end": 79,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 54,
"end": 77,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 61,
"end": 77,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 65,
"end": 76,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 65,
"end": 71,
"ctxt": 0
},
"value": "answer",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 74,
"end": 76,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
},
"definite": false
}
]
}
}
]
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 80,
"end": 93,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 89,
"end": 92,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 118,
"end": 150,
"ctxt": 0
},
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 125,
"end": 128,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 131,
"end": 149,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 139,
"end": 148,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "IfStatement",
"span": {
"start": 151,
"end": 176,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 154,
"end": 171,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "MemberExpression",
"span": {
"start": 154,
"end": 164,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 158,
"end": 164,
"ctxt": 0
},
"value": "answer",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 169,
"end": 171,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"stmts": []
},
"alternate": null
}
],
"interpreter": null
}