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

1351 lines
36 KiB
JSON

{
"type": "Script",
"span": {
"start": 63,
"end": 772,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 63,
"end": 186,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 72,
"end": 186,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 78,
"end": 111,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 85,
"end": 111,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 89,
"end": 111,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 89,
"end": 94,
"ctxt": 0
},
"value": "Point",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 97,
"end": 111,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 108,
"end": 109,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 116,
"end": 184,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 123,
"end": 184,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 138,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 139,
"end": 184,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 149,
"end": 159,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 150,
"end": 158,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 152,
"end": 158,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 168,
"end": 178,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 169,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 171,
"end": 177,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 189,
"end": 251,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 198,
"end": 251,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 204,
"end": 227,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 208,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "A",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 212,
"end": 226,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 220,
"end": 221,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 232,
"end": 249,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 239,
"end": 244,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"moduleRef": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 253,
"end": 430,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 262,
"end": 430,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 268,
"end": 378,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 275,
"end": 378,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 284,
"end": 378,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 294,
"end": 372,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 301,
"end": 372,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 311,
"end": 316,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 316,
"end": 372,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 330,
"end": 340,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 331,
"end": 339,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 333,
"end": 339,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 353,
"end": 362,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 354,
"end": 362,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 356,
"end": 362,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 384,
"end": 428,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 397,
"end": 398,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"declare": false,
"span": {
"start": 391,
"end": 428,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 409,
"end": 422,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 409,
"end": 413,
"ctxt": 0
},
"value": "name",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 413,
"end": 421,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 415,
"end": 421,
"ctxt": 0
},
"kind": "string"
}
},
"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": 432,
"end": 481,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 439,
"end": 440,
"ctxt": 0
},
"value": "Z",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 441,
"end": 481,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 447,
"end": 462,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 454,
"end": 455,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"value": "X",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "Y",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 468,
"end": 479,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 472,
"end": 478,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": "Y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 476,
"end": 478,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 487,
"end": 525,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 496,
"end": 525,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 500,
"end": 523,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 507,
"end": 523,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 513,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 516,
"end": 522,
"ctxt": 0
},
"kind": "number"
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 527,
"end": 585,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 534,
"end": 535,
"ctxt": 0
},
"value": "b",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 536,
"end": 585,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 540,
"end": 562,
"ctxt": 0
},
"declare": false,
"isExport": true,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 554,
"end": 555,
"ctxt": 0
},
"value": "A",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 558,
"end": 559,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 565,
"end": 583,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 572,
"end": 583,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 581,
"end": 583,
"ctxt": 0
},
"body": []
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 587,
"end": 619,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 594,
"end": 595,
"ctxt": 0
},
"value": "c",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 596,
"end": 619,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 600,
"end": 617,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 607,
"end": 610,
"ctxt": 0
},
"value": "any",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 613,
"end": 614,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 615,
"end": 616,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 625,
"end": 660,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 632,
"end": 633,
"ctxt": 0
},
"value": "q",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 634,
"end": 660,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 638,
"end": 658,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 645,
"end": 658,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 651,
"end": 657,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 651,
"end": 652,
"ctxt": 0
},
"value": "Q",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 655,
"end": 657,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 662,
"end": 725,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 669,
"end": 670,
"ctxt": 0
},
"value": "r",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 671,
"end": 725,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 675,
"end": 697,
"ctxt": 0
},
"declare": false,
"isExport": true,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 689,
"end": 690,
"ctxt": 0
},
"value": "Q",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 693,
"end": 694,
"ctxt": 0
},
"value": "q",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 695,
"end": 696,
"ctxt": 0
},
"value": "Q",
"optional": false
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 700,
"end": 723,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 707,
"end": 723,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 712,
"end": 713,
"ctxt": 0
},
"value": "Q",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 716,
"end": 722,
"ctxt": 0
},
"kind": "number"
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 727,
"end": 772,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 734,
"end": 735,
"ctxt": 0
},
"value": "s",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 736,
"end": 772,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 740,
"end": 755,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 747,
"end": 748,
"ctxt": 0
},
"value": "Q",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 751,
"end": 752,
"ctxt": 0
},
"value": "r",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 753,
"end": 754,
"ctxt": 0
},
"value": "Q",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 758,
"end": 770,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 764,
"end": 769,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 764,
"end": 765,
"ctxt": 0
},
"value": "Q",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 768,
"end": 769,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}