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

332 lines
7.5 KiB
JSON

{
"type": "Module",
"span": {
"start": 39,
"end": 224,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 45,
"end": 48,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 39,
"end": 68,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 52,
"end": 66,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 52,
"end": 56,
"ctxt": 0
},
"value": "test",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 59,
"end": 65,
"ctxt": 0
},
"value": "test",
"raw": "\"test\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 69,
"end": 108,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 76,
"end": 79,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 80,
"end": 108,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 83,
"end": 106,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 90,
"end": 106,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 94,
"end": 105,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"value": "answer",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 103,
"end": 105,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
},
"definite": false
}
]
}
}
]
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 109,
"end": 122,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 118,
"end": 121,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 147,
"end": 179,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 160,
"end": 178,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 168,
"end": 177,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "IfStatement",
"span": {
"start": 180,
"end": 224,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 183,
"end": 200,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "MemberExpression",
"span": {
"start": 183,
"end": 193,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 183,
"end": 186,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 187,
"end": 193,
"ctxt": 0
},
"value": "answer",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 201,
"end": 224,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 204,
"end": 222,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 208,
"end": 221,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 212,
"end": 221,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 216,
"end": 219,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"alternate": null
}
],
"interpreter": null
}