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

1560 lines
37 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 558,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 10,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 209,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 17,
"end": 27,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 17,
"end": 18,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 18,
"end": 26,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 20,
"end": 26,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 32,
"end": 39,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"value": "b",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 32,
"end": 39,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 44,
"end": 66,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"value": "c",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 44,
"end": 66,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 52,
"end": 66,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 54,
"end": 64,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 61,
"end": 63,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 71,
"end": 83,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "c",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 71,
"end": 83,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 80,
"end": 83,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 89,
"end": 106,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "r",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 97,
"end": 105,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 99,
"end": 105,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 111,
"end": 125,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "s",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 111,
"end": 125,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 122,
"end": 125,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 130,
"end": 159,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "t",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 130,
"end": 159,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 145,
"end": 159,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 147,
"end": 157,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 154,
"end": 156,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 164,
"end": 183,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": "t",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 164,
"end": 183,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 180,
"end": 183,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "Constructor",
"span": {
"start": 189,
"end": 207,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 189,
"end": 200,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 204,
"end": 207,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 217,
"end": 224,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 211,
"end": 241,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 233,
"end": 237,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 243,
"end": 275,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 247,
"end": 274,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 248,
"end": 257,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 250,
"end": 257,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 250,
"end": 257,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "NewExpression",
"span": {
"start": 260,
"end": 274,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 264,
"end": 271,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 276,
"end": 289,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 280,
"end": 288,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 280,
"end": 282,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 285,
"end": 288,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 290,
"end": 305,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 294,
"end": 304,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 294,
"end": 296,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 299,
"end": 304,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 299,
"end": 302,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 301,
"end": 302,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 306,
"end": 319,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 310,
"end": 318,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 310,
"end": 312,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 315,
"end": 318,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 315,
"end": 316,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 320,
"end": 329,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 320,
"end": 328,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 320,
"end": 323,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 320,
"end": 321,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 322,
"end": 323,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 326,
"end": 328,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 330,
"end": 349,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 334,
"end": 348,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 334,
"end": 336,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 339,
"end": 348,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 339,
"end": 346,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"value": "r",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 350,
"end": 371,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 354,
"end": 370,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 354,
"end": 356,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 359,
"end": 370,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 359,
"end": 368,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 359,
"end": 366,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": "s",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 372,
"end": 391,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 376,
"end": 390,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 376,
"end": 378,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 381,
"end": 390,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 381,
"end": 388,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 392,
"end": 407,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 392,
"end": 406,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 392,
"end": 401,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 392,
"end": 399,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 400,
"end": 401,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 404,
"end": 406,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 415,
"end": 420,
"ctxt": 0
},
"value": "Base2",
"optional": false
},
"declare": false,
"span": {
"start": 409,
"end": 472,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 428,
"end": 437,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 429,
"end": 437,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 431,
"end": 437,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 438,
"end": 446,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 440,
"end": 446,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 440,
"end": 446,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 427,
"end": 447,
"ctxt": 0
}
},
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 453,
"end": 462,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 454,
"end": 462,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 456,
"end": 462,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 463,
"end": 469,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 465,
"end": 469,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 465,
"end": 469,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 452,
"end": 470,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 480,
"end": 488,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"span": {
"start": 474,
"end": 506,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 497,
"end": 502,
"ctxt": 0
},
"value": "Base2",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 508,
"end": 525,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 512,
"end": 524,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 514,
"ctxt": 0
},
"value": "d2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 514,
"end": 524,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 516,
"end": 524,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 516,
"end": 524,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 526,
"end": 542,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 530,
"end": 541,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 530,
"end": 532,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 535,
"end": 541,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 535,
"end": 537,
"ctxt": 0
},
"value": "d2",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 537,
"end": 541,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 538,
"end": 540,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 543,
"end": 558,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 547,
"end": 557,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 547,
"end": 549,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 552,
"end": 557,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 552,
"end": 554,
"ctxt": 0
},
"value": "d2",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 554,
"end": 557,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 555,
"end": 556,
"ctxt": 0
},
"value": 1.0
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}