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

948 lines
40 KiB
JSON

{
"type": "Script",
"span": {
"start": 22,
"end": 674,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 22,
"end": 312,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 29,
"end": 33,
"ctxt": 0
},
"value": "Root",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 34,
"end": 312,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 40,
"end": 310,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 47,
"end": 310,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 56,
"end": 310,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 66,
"end": 146,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 73,
"end": 146,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 83,
"end": 88,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 89,
"end": 146,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 103,
"end": 113,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 104,
"end": 112,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 106,
"end": 112,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 126,
"end": 136,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 127,
"end": 135,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 129,
"end": 135,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 156,
"end": 304,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 163,
"end": 304,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 170,
"end": 175,
"ctxt": 0
},
"value": "Utils",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 176,
"end": 304,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 190,
"end": 294,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"value": "mirror",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 230,
"end": 234,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 230,
"end": 234,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 231,
"end": 234,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 197,
"end": 294,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 236,
"end": 294,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 254,
"end": 280,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 261,
"end": 279,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 263,
"end": 264,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 266,
"end": 269,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "p",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 274,
"end": 277,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": "p",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 212,
"end": 229,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 213,
"end": 228,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 223,
"end": 228,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 223,
"end": 228,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"typeParams": null
},
"default": null
}
]
},
"returnType": null
}
}
]
}
}
}
]
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 336,
"end": 674,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 343,
"end": 352,
"ctxt": 0
},
"value": "otherRoot",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 353,
"end": 674,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 359,
"end": 672,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 366,
"end": 672,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 375,
"end": 672,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 447,
"end": 496,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 454,
"end": 496,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 458,
"end": 495,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 458,
"end": 464,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 464,
"end": 478,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 466,
"end": 478,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 466,
"end": 470,
"ctxt": 0
},
"value": "Root",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 473,
"end": 478,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 481,
"end": 495,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 483,
"end": 484,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 486,
"end": 487,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 506,
"end": 666,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 513,
"end": 666,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 520,
"end": 525,
"ctxt": 0
},
"value": "Utils",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 526,
"end": 666,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 540,
"end": 656,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 553,
"end": 558,
"ctxt": 0
},
"value": "Plane",
"optional": false
},
"declare": false,
"span": {
"start": 547,
"end": 656,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 577,
"end": 642,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 577,
"end": 588,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 589,
"end": 612,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 596,
"end": 612,
"ctxt": 0
},
"value": "tl",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 598,
"end": 612,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 600,
"end": 612,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 600,
"end": 604,
"ctxt": 0
},
"value": "Root",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 605,
"end": 606,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 607,
"end": 612,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 614,
"end": 637,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 621,
"end": 637,
"ctxt": 0
},
"value": "br",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 623,
"end": 637,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 625,
"end": 637,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 625,
"end": 629,
"ctxt": 0
},
"value": "Root",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 630,
"end": 631,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 632,
"end": 637,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 639,
"end": 642,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
]
}
}
}
]
}
}
}
]
}
}
],
"interpreter": null
}