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

719 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 43,
"end": 916,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 43,
"end": 87,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 53,
"end": 58,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 59,
"end": 87,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 65,
"end": 85,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 65,
"end": 76,
"ctxt": 0
},
"value": "mixinMethod",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 78,
"end": 84,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 80,
"end": 84,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 159,
"end": 180,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 159,
"end": 180,
"ctxt": 0
},
"value": "baseClass",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 168,
"end": 180,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 170,
"end": 180,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 170,
"end": 180,
"ctxt": 0
},
"value": "TBaseClass",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 89,
"end": 507,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 235,
"end": 507,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 395,
"end": 405,
"ctxt": 0
},
"value": "MixinClass",
"optional": false
},
"declare": false,
"span": {
"start": 389,
"end": 482,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 451,
"end": 476,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 451,
"end": 462,
"ctxt": 0
},
"value": "mixinMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 451,
"end": 476,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 465,
"end": 476,
"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": 414,
"end": 423,
"ctxt": 0
},
"value": "baseClass",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 435,
"end": 440,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 435,
"end": 440,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"typeArguments": null
}
]
},
{
"type": "ReturnStatement",
"span": {
"start": 487,
"end": 505,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 494,
"end": 504,
"ctxt": 0
},
"value": "MixinClass",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 103,
"end": 158,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 104,
"end": 157,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 104,
"end": 114,
"ctxt": 0
},
"value": "TBaseClass",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsConstructorType",
"span": {
"start": 123,
"end": 157,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 137,
"end": 149,
"ctxt": 0
},
"rest": {
"start": 137,
"end": 140,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 140,
"end": 144,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 144,
"end": 149,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 146,
"end": 149,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 151,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"kind": "any"
}
},
"isAbstract": true
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 181,
"end": 234,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 183,
"end": 234,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 183,
"end": 193,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 183,
"end": 193,
"ctxt": 0
},
"value": "TBaseClass",
"optional": false
},
"typeParams": null
},
{
"type": "TsParenthesizedType",
"span": {
"start": 196,
"end": 234,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsConstructorType",
"span": {
"start": 197,
"end": 233,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 211,
"end": 223,
"ctxt": 0
},
"rest": {
"start": 211,
"end": 214,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 214,
"end": 218,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 218,
"end": 223,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 220,
"end": 223,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 225,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 228,
"end": 233,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 228,
"end": 233,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"typeParams": null
}
},
"isAbstract": true
}
}
]
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 524,
"end": 536,
"ctxt": 0
},
"value": "AbstractBase",
"optional": false
},
"declare": false,
"span": {
"start": 509,
"end": 581,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 543,
"end": 579,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 552,
"end": 570,
"ctxt": 0
},
"value": "abstractBaseMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 543,
"end": 579,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 572,
"end": 578,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 574,
"end": 578,
"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": "VariableDeclaration",
"span": {
"start": 583,
"end": 621,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 589,
"end": 620,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 589,
"end": 598,
"ctxt": 0
},
"value": "MixedBase",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 601,
"end": 620,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 601,
"end": 606,
"ctxt": 0
},
"value": "Mixin",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 607,
"end": 619,
"ctxt": 0
},
"value": "AbstractBase",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 790,
"end": 809,
"ctxt": 0
},
"value": "DerivedFromAbstract",
"optional": false
},
"declare": false,
"span": {
"start": 784,
"end": 831,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 818,
"end": 827,
"ctxt": 0
},
"value": "MixedBase",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 900,
"end": 916,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 900,
"end": 915,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 904,
"end": 913,
"ctxt": 0
},
"value": "MixedBase",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}