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

176 lines
4.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 81,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": true,
"span": {
"start": 0,
"end": 81,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 18,
"end": 50,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 18,
"end": 29,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 30,
"end": 48,
"ctxt": 0
},
"decorators": [],
"accessibility": null,
"override": false,
"readonly": true,
"param": {
"type": "Identifier",
"span": {
"start": 39,
"end": 48,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 40,
"end": 48,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 42,
"end": 48,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": null,
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 52,
"end": 79,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 59,
"end": 77,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 68,
"end": 77,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 69,
"end": 77,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 71,
"end": 77,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 52,
"end": 79,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}