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

417 lines
12 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 35,
"end": 240,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 43,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"declare": false,
"span": {
"start": 35,
"end": 240,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 50,
"end": 107,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 50,
"end": 57,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 51,
"end": 57,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 58,
"end": 71,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 58,
"end": 71,
"ctxt": 0
},
"value": "param",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 63,
"end": 71,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 65,
"end": 71,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 50,
"end": 107,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 81,
"end": 107,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 91,
"end": 101,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 98,
"end": 100,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 72,
"end": 80,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 74,
"end": 80,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "Constructor",
"span": {
"start": 112,
"end": 238,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 112,
"end": 123,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 124,
"end": 136,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 124,
"end": 136,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 128,
"end": 136,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 130,
"end": 136,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 138,
"end": 238,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 148,
"end": 164,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 148,
"end": 164,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 148,
"end": 160,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 148,
"end": 152,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 161,
"end": 163,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 173,
"end": 188,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 173,
"end": 188,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 173,
"end": 185,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 173,
"end": 177,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 178,
"end": 185,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 179,
"end": 185,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 206,
"end": 220,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 206,
"end": 220,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 206,
"end": 218,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 206,
"end": 210,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 211,
"end": 218,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 212,
"end": 218,
"ctxt": 0
},
"value": "method",
"optional": false
}
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}