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

270 lines
6.4 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 144,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 25,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 11,
"end": 23,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 11,
"end": 14,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 14,
"end": 22,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 16,
"end": 22,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"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": "VariableDeclaration",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 39,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "C",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 43,
"end": 45,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 57,
"end": 144,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 66,
"end": 144,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 72,
"end": 117,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 99,
"end": 111,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 99,
"end": 102,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 102,
"end": 110,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 104,
"end": 110,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"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": "VariableDeclaration",
"span": {
"start": 123,
"end": 133,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 127,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "D",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}