swc/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.json

1019 lines
35 KiB
JSON

{
"type": "Script",
"span": {
"start": 35,
"end": 581,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 42,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 35,
"end": 562,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 48,
"end": 66,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 48,
"end": 52,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 49,
"end": 52,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"value": "A's #foo",
"raw": "\"A's #foo\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "PrivateProperty",
"span": {
"start": 70,
"end": 88,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 71,
"end": 74,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 77,
"end": 87,
"ctxt": 0
},
"value": "A's #bar",
"raw": "\"A's #bar\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 92,
"end": 560,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 92,
"end": 560,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 102,
"end": 560,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 111,
"end": 433,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 132,
"end": 150,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 132,
"end": 136,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 136,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 139,
"end": 149,
"ctxt": 0
},
"value": "B's #foo",
"raw": "\"B's #foo\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 162,
"end": 265,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 162,
"end": 165,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 167,
"end": 173,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 167,
"end": 173,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 168,
"end": 173,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 170,
"end": 173,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 162,
"end": 265,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 175,
"end": 265,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 192,
"end": 199,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 194,
"end": 198,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 195,
"end": 198,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 277,
"end": 357,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 277,
"end": 280,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 282,
"end": 286,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 282,
"end": 286,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 283,
"end": 286,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 277,
"end": 357,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 288,
"end": 357,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 305,
"end": 312,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 305,
"end": 306,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 307,
"end": 311,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 308,
"end": 311,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 369,
"end": 424,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 369,
"end": 373,
"ctxt": 0
},
"value": "quux",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 375,
"end": 379,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 375,
"end": 379,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 376,
"end": 379,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 378,
"end": 379,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 378,
"end": 379,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 369,
"end": 424,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 381,
"end": 424,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 398,
"end": 405,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 398,
"end": 404,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 398,
"end": 399,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 400,
"end": 404,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 401,
"end": 404,
"ctxt": 0
},
"value": "foo",
"optional": 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": "VariableDeclaration",
"span": {
"start": 441,
"end": 459,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 447,
"end": 458,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 451,
"end": 458,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 455,
"end": 456,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 467,
"end": 482,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 467,
"end": 481,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 467,
"end": 478,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 467,
"end": 474,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 475,
"end": 478,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 490,
"end": 505,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 490,
"end": 504,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 490,
"end": 501,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 490,
"end": 497,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 498,
"end": 501,
"ctxt": 0
},
"value": "baz",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 502,
"end": 503,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 513,
"end": 531,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 519,
"end": 530,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 519,
"end": 520,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 523,
"end": 530,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 527,
"end": 528,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 539,
"end": 555,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 539,
"end": 554,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 539,
"end": 551,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 539,
"end": 546,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 547,
"end": 551,
"ctxt": 0
},
"value": "quux",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 552,
"end": 553,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"typeArguments": null
}
}
]
},
"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": "ExpressionStatement",
"span": {
"start": 564,
"end": 581,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 564,
"end": 580,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 564,
"end": 578,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 564,
"end": 571,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 568,
"end": 569,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 572,
"end": 578,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}