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

655 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 362,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 1,
"end": 86,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 10,
"end": 86,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 12,
"end": 86,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"value": "C",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 14,
"end": 86,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 20,
"end": 84,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 33,
"end": 38,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 27,
"end": 84,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 49,
"end": 59,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 50,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 68,
"end": 78,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 69,
"end": 77,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 71,
"end": 77,
"ctxt": 0
},
"kind": "number"
}
},
"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": 88,
"end": 198,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 97,
"end": 198,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 103,
"end": 196,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 110,
"end": 196,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 119,
"end": 196,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 129,
"end": 190,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 136,
"end": 190,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 167,
"end": 180,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 167,
"end": 171,
"ctxt": 0
},
"value": "name",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 171,
"end": 179,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 173,
"end": 179,
"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": 200,
"end": 276,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 207,
"end": 209,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 210,
"end": 276,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 212,
"end": 276,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 218,
"end": 274,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 231,
"end": 236,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 225,
"end": 274,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 247,
"end": 257,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 248,
"end": 256,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 250,
"end": 256,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 258,
"end": 268,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 258,
"end": 259,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 259,
"end": 267,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 261,
"end": 267,
"ctxt": 0
},
"kind": "number"
}
},
"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": 278,
"end": 362,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 285,
"end": 287,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 288,
"end": 362,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 294,
"end": 360,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 301,
"end": 360,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 310,
"end": 360,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 320,
"end": 345,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 327,
"end": 345,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 331,
"end": 344,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 331,
"end": 336,
"ctxt": 0
},
"value": "Point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 336,
"end": 344,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 338,
"end": 344,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
}
}
]
}
}
],
"interpreter": null
}