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

394 lines
8.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 232,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 10,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 9,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 5,
"end": 9,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 7,
"end": 9,
"ctxt": 0
},
"members": []
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 12,
"end": 46,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 27,
"end": 46,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 33,
"end": 44,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 33,
"end": 43,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 33,
"end": 39,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 33,
"end": 37,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"value": 1.0
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 54,
"end": 56,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 48,
"end": 78,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 65,
"end": 74,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 85,
"end": 87,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"declare": false,
"span": {
"start": 79,
"end": 104,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "BooleanLiteral",
"span": {
"start": 96,
"end": 100,
"ctxt": 0
},
"value": true
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 111,
"end": 113,
"ctxt": 0
},
"value": "C3",
"optional": false
},
"declare": false,
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "BooleanLiteral",
"span": {
"start": 122,
"end": 127,
"ctxt": 0
},
"value": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"value": "C4",
"optional": false
},
"declare": false,
"span": {
"start": 132,
"end": 155,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "NumericLiteral",
"span": {
"start": 149,
"end": 151,
"ctxt": 0
},
"value": 42.0
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 162,
"end": 164,
"ctxt": 0
},
"value": "C5",
"optional": false
},
"declare": false,
"span": {
"start": 156,
"end": 184,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "StringLiteral",
"span": {
"start": 173,
"end": 180,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 191,
"end": 193,
"ctxt": 0
},
"value": "C6",
"optional": false
},
"declare": false,
"span": {
"start": 185,
"end": 207,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "x",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 214,
"end": 216,
"ctxt": 0
},
"value": "C7",
"optional": false
},
"declare": false,
"span": {
"start": 208,
"end": 232,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 225,
"end": 228,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}