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

461 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 37,
"end": 158,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 37,
"end": 64,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 41,
"end": 63,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
},
"value": "getX",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 45,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 47,
"end": 63,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 48,
"end": 52,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 49,
"end": 52,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"kind": "number"
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 66,
"end": 131,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 80,
"end": 89,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 80,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 85,
"end": 88,
"ctxt": 0
},
"value": 100.0,
"raw": "100"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 94,
"end": 129,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 94,
"end": 124,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 95,
"end": 123,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 96,
"end": 122,
"ctxt": 0
},
"expressions": [
{
"type": "AssignmentExpression",
"span": {
"start": 96,
"end": 117,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 96,
"end": 100,
"ctxt": 0
},
"value": "getX",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ArrowFunctionExpression",
"span": {
"start": 103,
"end": 117,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 104,
"end": 108,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 113,
"end": 117,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 115,
"end": 117,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "StringLiteral",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"value": "_",
"raw": "\"_\""
}
]
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 94,
"end": 129,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 127,
"end": 129,
"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": 133,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 133,
"end": 157,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 133,
"end": 144,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 133,
"end": 140,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 141,
"end": 144,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 145,
"end": 156,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 145,
"end": 149,
"ctxt": 0
},
"value": "getX",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NewExpression",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}