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

774 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 489,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 11,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 126,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 18,
"end": 69,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 18,
"end": 29,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 30,
"end": 46,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 37,
"end": 46,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 38,
"end": 46,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 48,
"end": 64,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 55,
"end": 64,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 75,
"end": 124,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 75,
"end": 124,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 98,
"end": 124,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 100,
"end": 122,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 107,
"end": 121,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 92,
"end": 97,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 92,
"end": 97,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"typeParams": null
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 128,
"end": 216,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 135,
"end": 140,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 141,
"end": 216,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 156,
"end": 162,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 147,
"end": 179,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 165,
"end": 179,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 167,
"end": 177,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 174,
"end": 176,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 219,
"end": 489,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 228,
"end": 489,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 234,
"end": 379,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 247,
"end": 252,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 241,
"end": 379,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 263,
"end": 314,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 263,
"end": 274,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 275,
"end": 291,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 282,
"end": 291,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 283,
"end": 291,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 285,
"end": 291,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 293,
"end": 309,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 300,
"end": 309,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 301,
"end": 309,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 303,
"end": 309,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 311,
"end": 314,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 324,
"end": 373,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 331,
"end": 337,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 324,
"end": 373,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 347,
"end": 373,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 349,
"end": 371,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 356,
"end": 370,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 361,
"end": 362,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 339,
"end": 346,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 341,
"end": 346,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 341,
"end": 346,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"typeParams": null
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 385,
"end": 487,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 392,
"end": 487,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 399,
"end": 404,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 405,
"end": 487,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 424,
"end": 430,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 415,
"end": 447,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 433,
"end": 447,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 435,
"end": 445,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 442,
"end": 444,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
]
}
}
}
]
}
}
],
"interpreter": null
}