swc/crates/swc_ecma_parser/tests/tsc/amdImportAsPrimaryExpression.json
2022-04-05 12:46:35 +00:00

221 lines
4.6 KiB
JSON

{
"type": "Module",
"span": {
"start": 39,
"end": 237,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 39,
"end": 64,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 46,
"end": 64,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 51,
"end": 53,
"ctxt": 0
},
"value": "E1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 89,
"end": 121,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 96,
"end": 99,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 102,
"end": 120,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 110,
"end": 119,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "IfStatement",
"span": {
"start": 122,
"end": 237,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 125,
"end": 139,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "MemberExpression",
"span": {
"start": 125,
"end": 133,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 125,
"end": 128,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 129,
"end": 131,
"ctxt": 0
},
"value": "E1",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 140,
"end": 237,
"ctxt": 0
},
"stmts": []
},
"alternate": null
}
],
"interpreter": null
}