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

576 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 24,
"end": 470,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 24,
"end": 112,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 31,
"end": 32,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 33,
"end": 112,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 39,
"end": 110,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 46,
"end": 110,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 58,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 59,
"end": 110,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 69,
"end": 104,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 76,
"end": 104,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 80,
"end": 103,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 86,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 89,
"end": 103,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"definite": false
}
]
}
}
]
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 140,
"end": 253,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 149,
"end": 253,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 189,
"end": 251,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 205,
"end": 210,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 196,
"end": 251,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 213,
"end": 251,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 223,
"end": 245,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 230,
"end": 244,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 235,
"end": 236,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 238,
"end": 239,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 279,
"end": 470,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 288,
"end": 470,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 295,
"end": 366,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 302,
"end": 366,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 309,
"end": 314,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 315,
"end": 366,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 325,
"end": 360,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 332,
"end": 360,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 336,
"end": 359,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 336,
"end": 342,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 345,
"end": 359,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"definite": false
}
]
}
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 406,
"end": 468,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 422,
"end": 427,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 413,
"end": 468,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 430,
"end": 468,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 440,
"end": 462,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 447,
"end": 461,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 449,
"end": 450,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 452,
"end": 453,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 455,
"end": 456,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
],
"interpreter": null
}