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

625 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 160,
"end": 407,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 160,
"end": 375,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 174,
"end": 310,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 174,
"end": 185,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 188,
"end": 310,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 198,
"end": 213,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 202,
"end": 213,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 202,
"end": 206,
"ctxt": 0
},
"value": "self",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 209,
"end": 213,
"ctxt": 0
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 222,
"end": 232,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 222,
"end": 232,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 222,
"end": 226,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 241,
"end": 304,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 241,
"end": 304,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 241,
"end": 247,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 241,
"end": 245,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 246,
"end": 247,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": null,
"params": [],
"decorators": [],
"span": {
"start": 250,
"end": 304,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 261,
"end": 304,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 275,
"end": 294,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 275,
"end": 294,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 275,
"end": 286,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 275,
"end": 282,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 283,
"end": 286,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 287,
"end": 293,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 287,
"end": 291,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 315,
"end": 373,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 315,
"end": 320,
"ctxt": 0
},
"value": "mreal",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 315,
"end": 373,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 323,
"end": 373,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 333,
"end": 348,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 337,
"end": 348,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 337,
"end": 341,
"ctxt": 0
},
"value": "self",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ThisExpression",
"span": {
"start": 344,
"end": 348,
"ctxt": 0
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 357,
"end": 367,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 357,
"end": 367,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 357,
"end": 363,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 357,
"end": 361,
"ctxt": 0
},
"value": "self",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 362,
"end": 363,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
]
},
"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": "VariableDeclaration",
"span": {
"start": 376,
"end": 393,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 382,
"end": 393,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 382,
"end": 383,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 386,
"end": 393,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 394,
"end": 397,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 394,
"end": 397,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 396,
"end": 397,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 398,
"end": 401,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 398,
"end": 401,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 398,
"end": 399,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 400,
"end": 401,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 402,
"end": 407,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 402,
"end": 407,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 402,
"end": 405,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}