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

527 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 21,
"end": 287,
"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": 287,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 38,
"end": 41,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 38,
"end": 40,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 46,
"end": 285,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 46,
"end": 57,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 285,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 76,
"end": 83,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 70,
"end": 279,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 98,
"end": 100,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 114,
"end": 182,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 122,
"ctxt": 0
},
"value": "testBase",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 123,
"end": 130,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 123,
"end": 130,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 114,
"end": 182,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 132,
"end": 182,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 150,
"end": 168,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 150,
"end": 167,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 150,
"end": 161,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 150,
"end": 157,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 158,
"end": 161,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 162,
"end": 166,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 164,
"end": 166,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"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": 195,
"end": 269,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 195,
"end": 206,
"ctxt": 0
},
"value": "testDerived",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 207,
"end": 217,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 207,
"end": 217,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 210,
"end": 217,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 210,
"end": 217,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 195,
"end": 269,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 219,
"end": 269,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 237,
"end": 255,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 237,
"end": 254,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 237,
"end": 248,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 237,
"end": 244,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 245,
"end": 248,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 249,
"end": 253,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 251,
"end": 253,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 252,
"end": 253,
"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
}