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

332 lines
7.5 KiB
JSON

{
"type": "Module",
"span": {
"start": 40,
"end": 225,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 40,
"end": 69,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 53,
"end": 67,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 53,
"end": 57,
"ctxt": 0
},
"value": "test",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 60,
"end": 66,
"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": 70,
"end": 109,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 84,
"end": 107,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 91,
"end": 107,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 95,
"end": 106,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"value": "answer",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 104,
"end": 106,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
},
"definite": false
}
]
}
}
]
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 110,
"end": 123,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 148,
"end": 180,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 158,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 161,
"end": 179,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 169,
"end": 178,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "IfStatement",
"span": {
"start": 181,
"end": 225,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 184,
"end": 201,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "MemberExpression",
"span": {
"start": 184,
"end": 194,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 184,
"end": 187,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 188,
"end": 194,
"ctxt": 0
},
"value": "answer",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 199,
"end": 201,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 202,
"end": 225,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 205,
"end": 223,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 209,
"end": 222,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 213,
"end": 222,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 217,
"end": 220,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"alternate": null
}
],
"interpreter": null
}