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

196 lines
4.2 KiB
JSON

{
"type": "Module",
"span": {
"start": 40,
"end": 215,
"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": "TsImportEqualsDeclaration",
"span": {
"start": 104,
"end": 136,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 114,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 117,
"end": 135,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 125,
"end": 134,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "IfStatement",
"span": {
"start": 190,
"end": 215,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 193,
"end": 210,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "MemberExpression",
"span": {
"start": 193,
"end": 203,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 193,
"end": 196,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 197,
"end": 203,
"ctxt": 0
},
"value": "answer",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 208,
"end": 210,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 211,
"end": 215,
"ctxt": 0
},
"stmts": []
},
"alternate": null
}
],
"interpreter": null
}