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

643 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 160,
"end": 396,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 169,
"end": 175,
"ctxt": 0
},
"value": "Foonly",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 160,
"end": 276,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 178,
"end": 276,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 184,
"end": 199,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 188,
"end": 199,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 188,
"end": 192,
"ctxt": 0
},
"value": "self",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 195,
"end": 199,
"ctxt": 0
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 204,
"end": 214,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 204,
"end": 214,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 204,
"end": 210,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 204,
"end": 208,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 219,
"end": 274,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 219,
"end": 274,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 219,
"end": 225,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 219,
"end": 223,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 228,
"end": 274,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 239,
"end": 274,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 249,
"end": 268,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 249,
"end": 268,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 249,
"end": 260,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 249,
"end": 256,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 257,
"end": 260,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 261,
"end": 267,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 261,
"end": 265,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 277,
"end": 351,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 277,
"end": 351,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 277,
"end": 299,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 277,
"end": 293,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 277,
"end": 283,
"ctxt": 0
},
"value": "Foonly",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 284,
"end": 293,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 294,
"end": 299,
"ctxt": 0
},
"value": "mreal",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 302,
"end": 351,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 313,
"end": 351,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 319,
"end": 334,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 323,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 323,
"end": 327,
"ctxt": 0
},
"value": "self",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 330,
"end": 334,
"ctxt": 0
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 339,
"end": 349,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 339,
"end": 349,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 339,
"end": 345,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 339,
"end": 343,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 352,
"end": 376,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 358,
"end": 376,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 358,
"end": 361,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 364,
"end": 376,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 368,
"end": 374,
"ctxt": 0
},
"value": "Foonly",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 377,
"end": 382,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 377,
"end": 382,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 377,
"end": 380,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 383,
"end": 388,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 383,
"end": 388,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 383,
"end": 386,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 387,
"end": 388,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 389,
"end": 396,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 389,
"end": 396,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 389,
"end": 394,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 389,
"end": 392,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 393,
"end": 394,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}