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

1075 lines
30 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 522,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "K",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 189,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 15,
"end": 28,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 23,
"end": 27,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 33,
"end": 48,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 43,
"end": 47,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 53,
"end": 80,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 61,
"end": 74,
"ctxt": 0
},
"value": "privateMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 53,
"end": 80,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 85,
"end": 187,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "m",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 85,
"end": 187,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 89,
"end": 187,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 99,
"end": 131,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 103,
"end": 130,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 103,
"end": 123,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 109,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 118,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 146,
"end": 175,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 150,
"end": 174,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 150,
"end": 164,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 152,
"end": 156,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 152,
"end": 156,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 167,
"end": 174,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "K",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"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": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 190,
"end": 307,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 214,
"end": 305,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 214,
"end": 216,
"ctxt": 0
},
"value": "m2",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 214,
"end": 305,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 219,
"end": 305,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 229,
"end": 252,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 233,
"end": 251,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 233,
"end": 244,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 235,
"end": 239,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 247,
"end": 251,
"ctxt": 0
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 270,
"end": 293,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 274,
"end": 292,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 274,
"end": 285,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 276,
"end": 280,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 288,
"end": 292,
"ctxt": 0
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "K",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 308,
"end": 324,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 312,
"end": 323,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "k",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 316,
"end": 323,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "K",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 325,
"end": 342,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 329,
"end": 341,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 329,
"end": 337,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 331,
"end": 335,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 331,
"end": 335,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "k",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 352,
"end": 369,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 356,
"end": 368,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 356,
"end": 364,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 358,
"end": 362,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 358,
"end": 362,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": "k",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 379,
"end": 405,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 383,
"end": 404,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 383,
"end": 400,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 385,
"end": 398,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 385,
"end": 398,
"ctxt": 0
},
"value": "privateMethod",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 403,
"end": 404,
"ctxt": 0
},
"value": "k",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 415,
"end": 463,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 419,
"end": 462,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 419,
"end": 458,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 421,
"end": 425,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 430,
"end": 434,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 439,
"end": 452,
"ctxt": 0
},
"value": "privateMethod",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 454,
"end": 456,
"ctxt": 0
},
"value": "pm",
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"value": "k",
"optional": false
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 482,
"end": 483,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 484,
"end": 516,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ObjectPattern",
"span": {
"start": 484,
"end": 516,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 486,
"end": 490,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 486,
"end": 490,
"ctxt": 0
},
"value": "priv",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 492,
"end": 496,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 492,
"end": 496,
"ctxt": 0
},
"value": "prot",
"optional": false
},
"value": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 498,
"end": 511,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 498,
"end": 511,
"ctxt": 0
},
"value": "privateMethod",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 513,
"end": 516,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 515,
"end": 516,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 515,
"end": 516,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 473,
"end": 522,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 518,
"end": 522,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}