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

396 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 53,
"end": 242,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"declare": true,
"span": {
"start": 53,
"end": 96,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 80,
"end": 94,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 80,
"end": 85,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 85,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 87,
"end": 93,
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 103,
"end": 107,
"ctxt": 0
},
"value": "Lion",
"optional": false
},
"declare": false,
"span": {
"start": 97,
"end": 242,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 129,
"end": 144,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 129,
"end": 135,
"ctxt": 0
},
"value": "_sound",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 138,
"end": 144,
"ctxt": 0
},
"value": "roar",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 149,
"end": 191,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 153,
"end": 158,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 149,
"end": 191,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 191,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 171,
"end": 189,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 178,
"end": 189,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 178,
"end": 182,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 183,
"end": 189,
"ctxt": 0
},
"value": "_sound",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 160,
"end": 168,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 162,
"end": 168,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 196,
"end": 240,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 200,
"end": 205,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 206,
"end": 217,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 206,
"end": 217,
"ctxt": 0
},
"value": "val",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 209,
"end": 217,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 211,
"end": 217,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 196,
"end": 240,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 219,
"end": 240,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 221,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 221,
"end": 238,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 221,
"end": 232,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 221,
"end": 225,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 226,
"end": 232,
"ctxt": 0
},
"value": "_sound",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 235,
"end": 238,
"ctxt": 0
},
"value": "val",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}