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

1114 lines
27 KiB
JSON

{
"type": "Script",
"span": {
"start": 42,
"end": 841,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 42,
"end": 86,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 52,
"end": 57,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 58,
"end": 86,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 64,
"end": 84,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 64,
"end": 75,
"ctxt": 0
},
"value": "mixinMethod",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 79,
"end": 83,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 97,
"end": 102,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 158,
"end": 179,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 158,
"end": 179,
"ctxt": 0
},
"value": "baseClass",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 167,
"end": 179,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 169,
"end": 179,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 169,
"end": 179,
"ctxt": 0
},
"value": "TBaseClass",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 88,
"end": 367,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 234,
"end": 367,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 255,
"end": 265,
"ctxt": 0
},
"value": "MixinClass",
"optional": false
},
"declare": false,
"span": {
"start": 240,
"end": 342,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 311,
"end": 336,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 311,
"end": 322,
"ctxt": 0
},
"value": "mixinMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 311,
"end": 336,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 325,
"end": 336,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 274,
"end": 283,
"ctxt": 0
},
"value": "baseClass",
"optional": false
},
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 295,
"end": 300,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 295,
"end": 300,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"typeArguments": null
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 347,
"end": 365,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 354,
"end": 364,
"ctxt": 0
},
"value": "MixinClass",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 102,
"end": 157,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 103,
"end": 156,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 103,
"end": 113,
"ctxt": 0
},
"value": "TBaseClass",
"optional": false
},
"constraint": {
"type": "TsConstructorType",
"span": {
"start": 122,
"end": 156,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 136,
"end": 148,
"ctxt": 0
},
"rest": {
"start": 136,
"end": 139,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 139,
"end": 143,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 143,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 145,
"end": 148,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 150,
"end": 156,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 153,
"end": 156,
"ctxt": 0
},
"kind": "any"
}
},
"isAbstract": true
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 180,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 182,
"end": 233,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 182,
"end": 192,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 182,
"end": 192,
"ctxt": 0
},
"value": "TBaseClass",
"optional": false
},
"typeParams": null
},
{
"type": "TsParenthesizedType",
"span": {
"start": 195,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsConstructorType",
"span": {
"start": 196,
"end": 232,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 210,
"end": 222,
"ctxt": 0
},
"rest": {
"start": 210,
"end": 213,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 213,
"end": 217,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 217,
"end": 222,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 219,
"end": 222,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 224,
"end": 232,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"typeParams": null
}
},
"isAbstract": true
}
}
]
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 375,
"end": 387,
"ctxt": 0
},
"value": "ConcreteBase",
"optional": false
},
"declare": false,
"span": {
"start": 369,
"end": 411,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 394,
"end": 409,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 394,
"end": 404,
"ctxt": 0
},
"value": "baseMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 394,
"end": 409,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 407,
"end": 409,
"ctxt": 0
},
"stmts": []
},
"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": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 428,
"end": 440,
"ctxt": 0
},
"value": "AbstractBase",
"optional": false
},
"declare": false,
"span": {
"start": 413,
"end": 485,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 447,
"end": 483,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 456,
"end": 474,
"ctxt": 0
},
"value": "abstractBaseMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 447,
"end": 483,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 476,
"end": 482,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 478,
"end": 482,
"ctxt": 0
},
"kind": "void"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": true,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 493,
"end": 512,
"ctxt": 0
},
"value": "DerivedFromConcrete",
"optional": false
},
"declare": false,
"span": {
"start": 487,
"end": 544,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "CallExpression",
"span": {
"start": 521,
"end": 540,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 521,
"end": 526,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 527,
"end": 539,
"ctxt": 0
},
"value": "ConcreteBase",
"optional": false
}
}
],
"typeArguments": null
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 546,
"end": 592,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 552,
"end": 591,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 552,
"end": 563,
"ctxt": 0
},
"value": "wasConcrete",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 566,
"end": 591,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 570,
"end": 589,
"ctxt": 0
},
"value": "DerivedFromConcrete",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 593,
"end": 618,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 593,
"end": 617,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 593,
"end": 615,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 593,
"end": 604,
"ctxt": 0
},
"value": "wasConcrete",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 605,
"end": 615,
"ctxt": 0
},
"value": "baseMethod",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 619,
"end": 645,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 619,
"end": 644,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 619,
"end": 642,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 619,
"end": 630,
"ctxt": 0
},
"value": "wasConcrete",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 631,
"end": 642,
"ctxt": 0
},
"value": "mixinMethod",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 653,
"end": 672,
"ctxt": 0
},
"value": "DerivedFromAbstract",
"optional": false
},
"declare": false,
"span": {
"start": 647,
"end": 732,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 707,
"end": 730,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 707,
"end": 725,
"ctxt": 0
},
"value": "abstractBaseMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 707,
"end": 730,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 728,
"end": 730,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "CallExpression",
"span": {
"start": 681,
"end": 700,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 681,
"end": 686,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 687,
"end": 699,
"ctxt": 0
},
"value": "AbstractBase",
"optional": false
}
}
],
"typeArguments": null
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 734,
"end": 780,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 740,
"end": 779,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 740,
"end": 751,
"ctxt": 0
},
"value": "wasAbstract",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 754,
"end": 779,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 758,
"end": 777,
"ctxt": 0
},
"value": "DerivedFromAbstract",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 781,
"end": 814,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 781,
"end": 813,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 781,
"end": 811,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 781,
"end": 792,
"ctxt": 0
},
"value": "wasAbstract",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 793,
"end": 811,
"ctxt": 0
},
"value": "abstractBaseMethod",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 815,
"end": 841,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 815,
"end": 840,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 815,
"end": 838,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 815,
"end": 826,
"ctxt": 0
},
"value": "wasAbstract",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 827,
"end": 838,
"ctxt": 0
},
"value": "mixinMethod",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}