swc/crates/swc_ecma_parser/tests/tsc/privateNameUnused.json
2022-04-05 12:46:35 +00:00

1044 lines
29 KiB
JSON

{
"type": "Module",
"span": {
"start": 62,
"end": 524,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 62,
"end": 184,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 69,
"end": 184,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 83,
"end": 98,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 83,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 84,
"end": 88,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 91,
"end": 97,
"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": 103,
"end": 122,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 103,
"end": 110,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 104,
"end": 110,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 113,
"end": 121,
"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": 127,
"end": 182,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 127,
"end": 138,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 142,
"end": 182,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 152,
"end": 176,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 152,
"end": 175,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 152,
"end": 163,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 152,
"end": 159,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 160,
"end": 163,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 164,
"end": 174,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 169,
"end": 174,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 170,
"end": 174,
"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": 186,
"end": 304,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 199,
"end": 201,
"ctxt": 0
},
"value": "A2",
"optional": false
},
"declare": false,
"span": {
"start": 193,
"end": 304,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 208,
"end": 220,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 208,
"end": 213,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 209,
"end": 213,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 208,
"end": 220,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 216,
"end": 220,
"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": 220,
"end": 221,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 226,
"end": 239,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 226,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 227,
"end": 233,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 226,
"end": 239,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 236,
"end": 239,
"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": 239,
"end": 240,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 245,
"end": 302,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 245,
"end": 256,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 260,
"end": 302,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 270,
"end": 296,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 270,
"end": 295,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 270,
"end": 281,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 270,
"end": 277,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 278,
"end": 281,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 282,
"end": 294,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 282,
"end": 292,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 282,
"end": 286,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 287,
"end": 292,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 288,
"end": 292,
"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": 306,
"end": 524,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 319,
"end": 321,
"ctxt": 0
},
"value": "A3",
"optional": false
},
"declare": false,
"span": {
"start": 313,
"end": 524,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 328,
"end": 352,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 332,
"end": 337,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 333,
"end": 337,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 328,
"end": 352,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 340,
"end": 352,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 342,
"end": 350,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 349,
"end": 350,
"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": 352,
"end": 353,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 358,
"end": 387,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 362,
"end": 367,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 363,
"end": 367,
"ctxt": 0
},
"value": "used",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 368,
"end": 381,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 368,
"end": 381,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 373,
"end": 381,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 375,
"end": 381,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 358,
"end": 387,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 383,
"end": 387,
"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": 387,
"end": 388,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 398,
"end": 424,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 402,
"end": 409,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 403,
"end": 409,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 398,
"end": 424,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 412,
"end": 424,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 414,
"end": 422,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 421,
"end": 422,
"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": 424,
"end": 425,
"ctxt": 0
}
},
{
"type": "PrivateMethod",
"span": {
"start": 430,
"end": 461,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 434,
"end": 441,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 435,
"end": 441,
"ctxt": 0
},
"value": "unused",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 442,
"end": 455,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 442,
"end": 455,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 447,
"end": 455,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 449,
"end": 455,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 430,
"end": 461,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 457,
"end": 461,
"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": 461,
"end": 462,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 467,
"end": 522,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 467,
"end": 478,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 482,
"end": 522,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 492,
"end": 516,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 492,
"end": 515,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 492,
"end": 503,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 492,
"end": 499,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 500,
"end": 503,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 504,
"end": 514,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 504,
"end": 508,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 509,
"end": 514,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 510,
"end": 514,
"ctxt": 0
},
"value": "used",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
],
"interpreter": null
}