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

1044 lines
29 KiB
JSON

{
"type": "Module",
"span": {
"start": 63,
"end": 525,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 63,
"end": 185,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 70,
"end": 185,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 84,
"end": 99,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 84,
"end": 89,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 85,
"end": 89,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"value": "used",
"raw": "\"used\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 104,
"end": 123,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 104,
"end": 111,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 105,
"end": 111,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 114,
"end": 122,
"ctxt": 0
},
"value": "unused",
"raw": "\"unused\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 128,
"end": 183,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 128,
"end": 139,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 143,
"end": 183,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 153,
"end": 177,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 153,
"end": 176,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 153,
"end": 164,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 161,
"end": 164,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 165,
"end": 175,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 165,
"end": 169,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 170,
"end": 175,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 171,
"end": 175,
"ctxt": 0
},
"value": "used",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 187,
"end": 305,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 200,
"end": 202,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"declare": false,
"span": {
"start": 194,
"end": 305,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 209,
"end": 221,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 209,
"end": 214,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 210,
"end": 214,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 209,
"end": 221,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 217,
"end": 221,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 227,
"end": 240,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 227,
"end": 234,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 228,
"end": 234,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 227,
"end": 240,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 246,
"end": 303,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 246,
"end": 257,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 261,
"end": 303,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 271,
"end": 297,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 271,
"end": 296,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 271,
"end": 282,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 271,
"end": 278,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 279,
"end": 282,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 283,
"end": 295,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 283,
"end": 293,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 283,
"end": 287,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 288,
"end": 293,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 289,
"end": 293,
"ctxt": 0
},
"value": "used",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 307,
"end": 525,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 320,
"end": 322,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 314,
"end": 525,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 329,
"end": 353,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 333,
"end": 338,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 334,
"end": 338,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 329,
"end": 353,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 341,
"end": 353,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 343,
"end": 351,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 359,
"end": 388,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 363,
"end": 368,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 364,
"end": 368,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 369,
"end": 382,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 369,
"end": 382,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 374,
"end": 382,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 376,
"end": 382,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 359,
"end": 388,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 384,
"end": 388,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 388,
"end": 389,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 399,
"end": 425,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 403,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 404,
"end": 410,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 399,
"end": 425,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 413,
"end": 425,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 415,
"end": 423,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 431,
"end": 462,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 435,
"end": 442,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 436,
"end": 442,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 443,
"end": 456,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 443,
"end": 456,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 448,
"end": 456,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 450,
"end": 456,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 431,
"end": 462,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 458,
"end": 462,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 462,
"end": 463,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 468,
"end": 523,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 468,
"end": 479,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 483,
"end": 523,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 493,
"end": 517,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 493,
"end": 516,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 493,
"end": 504,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 493,
"end": 500,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 501,
"end": 504,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 505,
"end": 515,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 505,
"end": 509,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 510,
"end": 515,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 511,
"end": 515,
"ctxt": 0
},
"value": "used",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
],
"interpreter": null
}