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

1564 lines
45 KiB
JSON

{
"type": "Script",
"span": {
"start": 26,
"end": 838,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 26,
"end": 105,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 35,
"end": 105,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 41,
"end": 103,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 57,
"end": 62,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 48,
"end": 103,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 65,
"end": 103,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 75,
"end": 97,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 82,
"end": 96,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 131,
"end": 219,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 140,
"end": 219,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 146,
"end": 217,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 153,
"end": 217,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 160,
"end": 165,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 166,
"end": 217,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 176,
"end": 211,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 183,
"end": 211,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 187,
"end": 210,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 187,
"end": 193,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 196,
"end": 210,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
}
}
]
}
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 243,
"end": 282,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 247,
"end": 281,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 247,
"end": 249,
"ctxt": 0
},
"value": "fn",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 249,
"end": 281,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 251,
"end": 281,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 254,
"end": 281,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 257,
"end": 281,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 259,
"end": 269,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 260,
"end": 268,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 262,
"end": 268,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 270,
"end": 279,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 270,
"end": 271,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 271,
"end": 279,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 273,
"end": 279,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 283,
"end": 300,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 287,
"end": 299,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 287,
"end": 289,
"ctxt": 0
},
"value": "fn",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 292,
"end": 299,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 294,
"end": 299,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 302,
"end": 335,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 306,
"end": 335,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 306,
"end": 308,
"ctxt": 0
},
"value": "cl",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 308,
"end": 335,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 310,
"end": 335,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 312,
"end": 322,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 313,
"end": 321,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 315,
"end": 321,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 323,
"end": 333,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 324,
"end": 332,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 326,
"end": 332,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 336,
"end": 355,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 340,
"end": 354,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": "cl",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 345,
"end": 354,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 347,
"end": 352,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 356,
"end": 380,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 360,
"end": 379,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 360,
"end": 362,
"ctxt": 0
},
"value": "cl",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 365,
"end": 379,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 365,
"end": 372,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 365,
"end": 366,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 367,
"end": 372,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 373,
"end": 379,
"ctxt": 0
},
"value": "Origin",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 439,
"end": 596,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 448,
"end": 596,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 455,
"end": 517,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 471,
"end": 476,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 462,
"end": 517,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 479,
"end": 517,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 489,
"end": 511,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 496,
"end": 510,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 498,
"end": 499,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 501,
"end": 502,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 504,
"end": 505,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 507,
"end": 508,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 523,
"end": 594,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 530,
"end": 594,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 537,
"end": 542,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 543,
"end": 594,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 553,
"end": 588,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 560,
"end": 588,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 564,
"end": 587,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 564,
"end": 570,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 573,
"end": 587,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 575,
"end": 576,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 578,
"end": 579,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 581,
"end": 582,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 584,
"end": 585,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
}
}
]
}
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 598,
"end": 637,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 602,
"end": 636,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 602,
"end": 604,
"ctxt": 0
},
"value": "fn",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 604,
"end": 636,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 606,
"end": 636,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 609,
"end": 636,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 612,
"end": 636,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 614,
"end": 624,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 614,
"end": 615,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 615,
"end": 623,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 617,
"end": 623,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 625,
"end": 634,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 625,
"end": 626,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 626,
"end": 634,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 628,
"end": 634,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 638,
"end": 655,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 642,
"end": 654,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 642,
"end": 644,
"ctxt": 0
},
"value": "fn",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 647,
"end": 654,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 647,
"end": 648,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 649,
"end": 654,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 760,
"end": 793,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 764,
"end": 793,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 764,
"end": 766,
"ctxt": 0
},
"value": "cl",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 766,
"end": 793,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 768,
"end": 793,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 770,
"end": 780,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 770,
"end": 771,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 771,
"end": 779,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 773,
"end": 779,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 781,
"end": 791,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 781,
"end": 782,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 782,
"end": 790,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 784,
"end": 790,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 794,
"end": 813,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 798,
"end": 812,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 798,
"end": 800,
"ctxt": 0
},
"value": "cl",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 803,
"end": 812,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 803,
"end": 810,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 803,
"end": 804,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 805,
"end": 810,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 814,
"end": 838,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 818,
"end": 837,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 818,
"end": 820,
"ctxt": 0
},
"value": "cl",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 823,
"end": 837,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 823,
"end": 830,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 823,
"end": 824,
"ctxt": 0
},
"value": "B",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 825,
"end": 830,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 831,
"end": 837,
"ctxt": 0
},
"value": "Origin",
"optional": false
}
},
"definite": false
}
]
}
],
"interpreter": null
}