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

894 lines
25 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 714,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 1,
"end": 147,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 10,
"end": 147,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 117,
"end": 128,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 121,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "A",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 133,
"end": 145,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 137,
"end": 144,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 137,
"end": 139,
"ctxt": 0
},
"value": "_A",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 142,
"end": 144,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 149,
"end": 177,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 158,
"end": 177,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 164,
"end": 175,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 168,
"end": 174,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "A",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 172,
"end": 174,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 179,
"end": 315,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 188,
"end": 315,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 276,
"end": 313,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 294,
"end": 307,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 294,
"end": 298,
"ctxt": 0
},
"value": "name",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 298,
"end": 306,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 300,
"end": 306,
"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": 317,
"end": 501,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 324,
"end": 325,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 326,
"end": 501,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 332,
"end": 343,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 336,
"end": 342,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "X",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": 13.0,
"raw": "13"
},
"definite": false
}
]
},
{
"type": "ExportDeclaration",
"span": {
"start": 348,
"end": 499,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 355,
"end": 499,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 362,
"end": 363,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 364,
"end": 499,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 374,
"end": 385,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 378,
"end": 384,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 378,
"end": 379,
"ctxt": 0
},
"value": "Y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 382,
"end": 384,
"ctxt": 0
},
"value": 13.0,
"raw": "13"
},
"definite": false
}
]
},
{
"type": "ExportDeclaration",
"span": {
"start": 394,
"end": 493,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 401,
"end": 493,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"value": "Z",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 410,
"end": 493,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 424,
"end": 435,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 428,
"end": 434,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 428,
"end": 429,
"ctxt": 0
},
"value": "X",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 432,
"end": 434,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 448,
"end": 459,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 452,
"end": 458,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 452,
"end": 453,
"ctxt": 0
},
"value": "Y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 456,
"end": 458,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 472,
"end": 483,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 476,
"end": 482,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 476,
"end": 477,
"ctxt": 0
},
"value": "Z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 480,
"end": 482,
"ctxt": 0
},
"value": 12.0,
"raw": "12"
},
"definite": false
}
]
}
]
}
}
}
]
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 503,
"end": 561,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 510,
"end": 511,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 512,
"end": 561,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 513,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 514,
"end": 561,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 520,
"end": 559,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 527,
"end": 559,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 532,
"end": 533,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 544,
"end": 547,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 544,
"end": 547,
"ctxt": 0
},
"value": "Red",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 549,
"end": 553,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 549,
"end": 553,
"ctxt": 0
},
"value": "Blue",
"optional": false
},
"init": null
}
]
}
}
]
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 622,
"end": 714,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 629,
"end": 630,
"ctxt": 0
},
"value": "D",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 631,
"end": 714,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 637,
"end": 683,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 644,
"end": 683,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 654,
"end": 655,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 656,
"end": 683,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 666,
"end": 677,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 666,
"end": 668,
"ctxt": 0
},
"value": "id",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 668,
"end": 676,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 670,
"end": 676,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 689,
"end": 712,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 696,
"end": 712,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 700,
"end": 711,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 700,
"end": 701,
"ctxt": 0
},
"value": "E",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 704,
"end": 711,
"ctxt": 0
},
"value": "hello",
"raw": "'hello'"
},
"definite": false
}
]
}
}
]
}
}
],
"interpreter": null
}