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

619 lines
22 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 21,
"end": 327,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 27,
"end": 31,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 21,
"end": 327,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 38,
"end": 60,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 42,
"end": 44,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 38,
"end": 60,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 47,
"end": 60,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 49,
"end": 58,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
}
},
{
"type": "Constructor",
"span": {
"start": 66,
"end": 325,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 66,
"end": 77,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 80,
"end": 325,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 96,
"end": 103,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 90,
"end": 319,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 118,
"end": 140,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 122,
"end": 124,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 118,
"end": 140,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 127,
"end": 140,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 129,
"end": 138,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "EmptyStatement",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
}
},
{
"type": "ClassMethod",
"span": {
"start": 154,
"end": 222,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"value": "testBase",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 163,
"end": 170,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 163,
"end": 170,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 166,
"end": 170,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 166,
"end": 170,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 154,
"end": 222,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 222,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 190,
"end": 208,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 190,
"end": 207,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 190,
"end": 201,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 190,
"end": 197,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 198,
"end": 201,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 202,
"end": 206,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 204,
"end": 206,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 235,
"end": 309,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 235,
"end": 246,
"ctxt": 0
},
"value": "testDerived",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 247,
"end": 257,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 247,
"end": 257,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 248,
"end": 257,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 250,
"end": 257,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 250,
"end": 257,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 235,
"end": 309,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 259,
"end": 309,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 277,
"end": 295,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 277,
"end": 294,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 277,
"end": 288,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 277,
"end": 284,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 285,
"end": 288,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 289,
"end": 293,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 289,
"end": 290,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 291,
"end": 293,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "x",
"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": []
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}