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

784 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 584,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 12,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 163,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 19,
"end": 70,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 19,
"end": 30,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 31,
"end": 47,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 38,
"end": 47,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 39,
"end": 47,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 41,
"end": 47,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 49,
"end": 65,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 59,
"end": 65,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 67,
"end": 70,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 76,
"end": 125,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 83,
"end": 89,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 76,
"end": 125,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 99,
"end": 125,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 101,
"end": 123,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 108,
"end": 122,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 91,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 93,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 93,
"end": 98,
"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": 165,
"end": 265,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 178,
"end": 265,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 184,
"end": 225,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 200,
"end": 206,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 191,
"end": 225,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 209,
"end": 225,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 211,
"end": 223,
"ctxt": 0
},
"argument": {
"type": "NullLiteral",
"span": {
"start": 218,
"end": 222,
"ctxt": 0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 268,
"end": 584,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 277,
"end": 584,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 283,
"end": 464,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 296,
"end": 301,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 290,
"end": 464,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 312,
"end": 363,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 312,
"end": 323,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 324,
"end": 340,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 331,
"end": 340,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 332,
"end": 340,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 334,
"end": 340,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 342,
"end": 358,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 349,
"end": 358,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 350,
"end": 358,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 352,
"end": 358,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 360,
"end": 363,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 373,
"end": 422,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 380,
"end": 386,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 373,
"end": 422,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 396,
"end": 422,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 398,
"end": 420,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 405,
"end": 419,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 413,
"end": 414,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 388,
"end": 395,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 390,
"end": 395,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 390,
"end": 395,
"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": 470,
"end": 582,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 477,
"end": 582,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 484,
"end": 489,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 490,
"end": 582,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 500,
"end": 539,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 516,
"end": 522,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 507,
"end": 539,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 525,
"end": 539,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 527,
"end": 537,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 534,
"end": 536,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
}
]
}
}
],
"interpreter": null
}