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

440 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 235,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 25,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 13,
"end": 25,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 13,
"end": 20,
"ctxt": 0
},
"value": "Factory",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 20,
"end": 25,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 33,
"end": 37,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 27,
"end": 64,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 44,
"end": 62,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 44,
"end": 55,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 59,
"end": 62,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 65,
"end": 235,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 92,
"end": 103,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 100,
"end": 102,
"ctxt": 0
},
"value": "_t",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 108,
"end": 233,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 108,
"end": 119,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 122,
"end": 233,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 132,
"end": 141,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 132,
"end": 140,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "i",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 150,
"end": 192,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 154,
"end": 192,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 158,
"end": 192,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "t",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 175,
"end": 182,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 175,
"end": 179,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 180,
"end": 182,
"ctxt": 0
},
"value": "_t",
"optional": false
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 201,
"end": 227,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 205,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 209,
"end": 226,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 209,
"end": 223,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 209,
"end": 216,
"ctxt": 0
},
"value": "Factory",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 217,
"end": 223,
"ctxt": 0
},
"value": "create",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 81,
"end": 85,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}