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

766 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 362,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 8,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 51,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 15,
"end": 49,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 15,
"end": 26,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 27,
"end": 44,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 34,
"end": 44,
"ctxt": 0
},
"value": "x",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 44,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 38,
"end": 44,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 52,
"end": 63,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 56,
"end": 58,
"ctxt": 0
},
"value": "c1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 60,
"end": 62,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 60,
"end": 62,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"value": "c1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 83,
"end": 85,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"declare": false,
"span": {
"start": 77,
"end": 129,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 92,
"end": 127,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 92,
"end": 103,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 104,
"end": 122,
"ctxt": 0
},
"decorators": [],
"accessibility": "private",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 112,
"end": 122,
"ctxt": 0
},
"value": "p",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 114,
"end": 122,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 130,
"end": 141,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 134,
"end": 140,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 136,
"ctxt": 0
},
"value": "c2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 142,
"end": 144,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 145,
"end": 146,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 173,
"end": 175,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"declare": false,
"span": {
"start": 167,
"end": 221,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 182,
"end": 219,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 182,
"end": 193,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 194,
"end": 214,
"ctxt": 0
},
"decorators": [],
"accessibility": "protected",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 204,
"end": 214,
"ctxt": 0
},
"value": "p",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 216,
"end": 219,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 233,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 232,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"value": "c3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 228,
"end": 232,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 230,
"end": 232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 230,
"end": 232,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 234,
"end": 236,
"ctxt": 0
},
"value": "c3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 265,
"end": 272,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 259,
"end": 362,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 290,
"end": 360,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 290,
"end": 301,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 302,
"end": 311,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 302,
"end": 311,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 303,
"end": 311,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 313,
"end": 360,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 323,
"end": 332,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 323,
"end": 331,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 323,
"end": 328,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 341,
"end": 348,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 341,
"end": 347,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 341,
"end": 345,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 346,
"end": 347,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 281,
"end": 283,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}