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

594 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 253,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 1,
"end": 32,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 6,
"end": 14,
"ctxt": 0
},
"value": "enumdule",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"value": "Red",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 26,
"end": 30,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 26,
"end": 30,
"ctxt": 0
},
"value": "Blue",
"optional": false
},
"init": null
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 34,
"end": 145,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 41,
"end": 49,
"ctxt": 0
},
"value": "enumdule",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 50,
"end": 145,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 57,
"end": 143,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 70,
"end": 75,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 64,
"end": 143,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 86,
"end": 137,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 86,
"end": 97,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 98,
"end": 114,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 105,
"end": 114,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 106,
"end": 114,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 108,
"end": 114,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 116,
"end": 132,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 123,
"end": 132,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 132,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 126,
"end": 132,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 147,
"end": 163,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 151,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 162,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"value": "enumdule",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 164,
"end": 185,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 168,
"end": 184,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 172,
"end": 184,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 172,
"end": 180,
"ctxt": 0
},
"value": "enumdule",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"value": "Red",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 187,
"end": 219,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 191,
"end": 218,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 192,
"end": 218,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 194,
"end": 218,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 196,
"end": 206,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 197,
"end": 205,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 199,
"end": 205,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 207,
"end": 216,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 210,
"end": 216,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 220,
"end": 253,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 224,
"end": 252,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 228,
"end": 252,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 232,
"end": 246,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 232,
"end": 240,
"ctxt": 0
},
"value": "enumdule",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 241,
"end": 246,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}