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

385 lines
9.4 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 191,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 10,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 55,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 17,
"end": 53,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 17,
"end": 28,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 29,
"end": 48,
"ctxt": 0
},
"decorators": [],
"accessibility": "protected",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 39,
"end": 48,
"ctxt": 0
},
"value": "p",
"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": {
"type": "BlockStatement",
"span": {
"start": 50,
"end": 53,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 63,
"end": 70,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 57,
"end": 169,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 90,
"end": 167,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 90,
"end": 101,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 102,
"end": 118,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 120,
"end": 167,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 130,
"end": 139,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 130,
"end": 138,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 148,
"end": 155,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 148,
"end": 154,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 148,
"end": 152,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 79,
"end": 83,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 171,
"end": 186,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 175,
"end": 185,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 176,
"end": 185,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 178,
"end": 185,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 178,
"end": 185,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 187,
"end": 191,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 190,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
],
"interpreter": null
}