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

401 lines
9.4 KiB
JSON

{
"type": "Module",
"span": {
"start": 75,
"end": 390,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 75,
"end": 317,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 82,
"end": 317,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 167,
"end": 206,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 167,
"end": 206,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 178,
"end": 206,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 188,
"end": 200,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 195,
"end": 199,
"ctxt": 0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 283,
"end": 315,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 283,
"end": 284,
"ctxt": 0
},
"value": "b",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 283,
"end": 315,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 287,
"end": 315,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 297,
"end": 309,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 304,
"end": 308,
"ctxt": 0
}
}
}
]
},
"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": 319,
"end": 335,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 325,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 325,
"end": 326,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 329,
"end": 334,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 329,
"end": 332,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 336,
"end": 338,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 352,
"end": 370,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 358,
"end": 369,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 362,
"end": 369,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 371,
"end": 387,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 377,
"end": 386,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 381,
"end": 386,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 381,
"end": 384,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 388,
"end": 390,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 388,
"end": 389,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
],
"interpreter": null
}