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

662 lines
25 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 20,
"end": 244,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 30,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"declare": false,
"span": {
"start": 20,
"end": 244,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 37,
"end": 46,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 37,
"end": 39,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 42,
"end": 45,
"ctxt": 0
},
"value": 123.0,
"raw": "123"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 51,
"end": 242,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 58,
"end": 67,
"ctxt": 0
},
"value": "something",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 68,
"end": 96,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 68,
"end": 96,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 71,
"end": 96,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 73,
"end": 96,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 76,
"end": 87,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 87,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 81,
"end": 87,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 94,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 90,
"end": 94,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 90,
"end": 94,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 75,
"end": 94,
"ctxt": 0
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 51,
"end": 242,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 98,
"end": 242,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 108,
"end": 167,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 108,
"end": 166,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 108,
"end": 162,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 108,
"end": 159,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 108,
"end": 111,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 111,
"end": 159,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 112,
"end": 158,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 112,
"end": 156,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 113,
"end": 155,
"ctxt": 0
},
"callee": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 117,
"end": 155,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 125,
"end": 132,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 133,
"end": 153,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "s",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"value": "prop",
"raw": "\"prop\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": true,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"arguments": null,
"typeArguments": null
}
},
"property": {
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 160,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 176,
"end": 236,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 176,
"end": 235,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "MemberExpression",
"span": {
"start": 176,
"end": 230,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 176,
"end": 227,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 179,
"end": 227,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 180,
"end": 226,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 180,
"end": 224,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 181,
"end": 223,
"ctxt": 0
},
"callee": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 185,
"end": 223,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateProperty",
"span": {
"start": 193,
"end": 200,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 193,
"end": 195,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isOptional": false,
"isOverride": false,
"readonly": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 201,
"end": 221,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "s",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 214,
"end": 220,
"ctxt": 0
},
"value": "prop",
"raw": "\"prop\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": true,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"arguments": null,
"typeArguments": null
}
},
"property": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 228,
"end": 230,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 234,
"end": 235,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"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": []
}
],
"interpreter": null
}