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

698 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 437,
"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": 115,
"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": "ClassProperty",
"span": {
"start": 75,
"end": 113,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 98,
"end": 112,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 90,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 90,
"end": 95,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"typeParams": null
}
},
"isStatic": true,
"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": 117,
"end": 190,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 130,
"end": 190,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 136,
"end": 152,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 140,
"end": 151,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 140,
"end": 146,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 149,
"end": 151,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 193,
"end": 437,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 202,
"end": 437,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 208,
"end": 342,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 221,
"end": 226,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"span": {
"start": 215,
"end": 342,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 237,
"end": 288,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 237,
"end": 248,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 249,
"end": 265,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 256,
"end": 265,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 259,
"end": 265,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 267,
"end": 283,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 274,
"end": 283,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 275,
"end": 283,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 277,
"end": 283,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 285,
"end": 288,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassProperty",
"span": {
"start": 298,
"end": 336,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"value": "Origin",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 321,
"end": 335,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 326,
"end": 327,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 332,
"end": 333,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 311,
"end": 318,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 313,
"end": 318,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 313,
"end": 318,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"typeParams": null
}
},
"isStatic": true,
"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": "ExportDeclaration",
"span": {
"start": 348,
"end": 435,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 355,
"end": 435,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 362,
"end": 367,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 368,
"end": 435,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 378,
"end": 394,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 382,
"end": 393,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 382,
"end": 388,
"ctxt": 0
},
"value": "Origin",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 391,
"end": 393,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"definite": false
}
]
}
]
}
}
}
]
}
}
],
"interpreter": null
}