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

524 lines
15 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 21,
"end": 264,
"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": 158,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 38,
"end": 81,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 49,
"end": 54,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 54,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 38,
"end": 81,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 65,
"end": 81,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 67,
"end": 79,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 75,
"end": 78,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"kind": "number"
}
}
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 86,
"end": 156,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 100,
"end": 117,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 100,
"end": 117,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 117,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 103,
"end": 117,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 110,
"end": 117,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeArguments": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 86,
"end": 156,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 119,
"end": 156,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 129,
"end": 150,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 129,
"end": 149,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 129,
"end": 140,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 141,
"end": 148,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 143,
"end": 148,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 144,
"end": 148,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 165,
"end": 172,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 159,
"end": 264,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 192,
"end": 262,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 199,
"end": 205,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 206,
"end": 223,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 206,
"end": 223,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 207,
"end": 223,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 209,
"end": 223,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 216,
"end": 223,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeArguments": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 192,
"end": 262,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 225,
"end": 262,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 235,
"end": 256,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 235,
"end": 255,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 235,
"end": 246,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 235,
"end": 242,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 243,
"end": 246,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 247,
"end": 254,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 249,
"end": 254,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 250,
"end": 254,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 181,
"end": 185,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}