swc/crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessors.json
2022-02-04 17:08:38 +09:00

658 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 34,
"end": 325,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 40,
"end": 42,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"declare": false,
"span": {
"start": 34,
"end": 325,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 49,
"end": 82,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 60,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 61,
"end": 65,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 49,
"end": 82,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 68,
"end": 82,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 70,
"end": 80,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 77,
"end": 79,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 87,
"end": 122,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 99,
"end": 103,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 104,
"end": 117,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 104,
"end": 117,
"ctxt": 0
},
"value": "param",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 109,
"end": 117,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 111,
"end": 117,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 87,
"end": 122,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 128,
"end": 163,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 139,
"end": 146,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 140,
"end": 146,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 128,
"end": 163,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 149,
"end": 163,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 151,
"end": 161,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 158,
"end": 160,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "Constructor",
"span": {
"start": 169,
"end": 323,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 169,
"end": 180,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 181,
"end": 193,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 181,
"end": 193,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 185,
"end": 193,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 187,
"end": 193,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 195,
"end": 323,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 205,
"end": 219,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 205,
"end": 218,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 205,
"end": 213,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 205,
"end": 207,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 208,
"end": 213,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 209,
"end": 213,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 216,
"end": 218,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 228,
"end": 244,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 228,
"end": 243,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 228,
"end": 238,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 228,
"end": 230,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 231,
"end": 238,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 232,
"end": 238,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 241,
"end": 243,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 262,
"end": 284,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 262,
"end": 283,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 262,
"end": 273,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 270,
"end": 273,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 274,
"end": 282,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 274,
"end": 276,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 277,
"end": 282,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 278,
"end": 282,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 293,
"end": 317,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 293,
"end": 316,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 293,
"end": 304,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 301,
"end": 304,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 305,
"end": 315,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 305,
"end": 307,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 308,
"end": 315,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 309,
"end": 315,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}