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

300 lines
7.4 KiB
JSON

{
"type": "Script",
"span": {
"start": 18,
"end": 175,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 18,
"end": 175,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 40,
"end": 57,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 40,
"end": 57,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": true,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 61,
"end": 92,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 74,
"end": 76,
"ctxt": 0
},
"value": "aa",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 61,
"end": 92,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 92,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 81,
"end": 90,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": true,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "b",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": true,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 135,
"end": 164,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 148,
"end": 150,
"ctxt": 0
},
"value": "bb",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 135,
"end": 164,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 162,
"end": 164,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": true,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}