swc/crates/swc_ecma_parser/tests/tsc/classAndVariableWithSameName.json
2022-03-22 07:54:08 +00:00

269 lines
6.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 143,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 7,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 24,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 10,
"end": 22,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 13,
"end": 21,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 15,
"end": 21,
"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": 34,
"end": 45,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 38,
"end": 44,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "C",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 42,
"end": 44,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 56,
"end": 143,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 65,
"end": 143,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 71,
"end": 116,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 98,
"end": 110,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 109,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 103,
"end": 109,
"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": 122,
"end": 132,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 126,
"end": 131,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": "D",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": 1.0
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}