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

463 lines
13 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 36,
"end": 157,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 36,
"end": 63,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 40,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 40,
"end": 44,
"ctxt": 0
},
"value": "getX",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 44,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 46,
"end": 62,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 47,
"end": 51,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 48,
"end": 51,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"kind": "number"
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 65,
"end": 130,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 79,
"end": 88,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 79,
"end": 81,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"value": 100.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false
},
{
"type": "ClassMethod",
"span": {
"start": 93,
"end": 128,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 93,
"end": 123,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 94,
"end": 122,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 95,
"end": 121,
"ctxt": 0
},
"expressions": [
{
"type": "AssignmentExpression",
"span": {
"start": 95,
"end": 116,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 95,
"end": 99,
"ctxt": 0
},
"value": "getX",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 102,
"end": 116,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 103,
"end": 107,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 112,
"end": 116,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 114,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "StringLiteral",
"span": {
"start": 118,
"end": 121,
"ctxt": 0
},
"value": "_",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
]
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 93,
"end": 128,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 126,
"end": 128,
"ctxt": 0
},
"stmts": []
},
"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": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 132,
"end": 157,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 132,
"end": 156,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 132,
"end": 143,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 132,
"end": 139,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 140,
"end": 143,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 144,
"end": 155,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 144,
"end": 148,
"ctxt": 0
},
"value": "getX",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 149,
"end": 154,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}