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

402 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 115,
"end": 339,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 115,
"end": 234,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 115,
"end": 234,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 115,
"end": 129,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 115,
"end": 121,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 122,
"end": 129,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 132,
"end": 234,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 185,
"end": 232,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 185,
"end": 196,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 200,
"end": 232,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 210,
"end": 226,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 210,
"end": 225,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 210,
"end": 216,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 210,
"end": 214,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "t",
"optional": false
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 219,
"end": 225,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "NumericLiteral",
"span": {
"start": 219,
"end": 221,
"ctxt": 0
},
"value": 12.0
},
"right": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 235,
"end": 339,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 235,
"end": 339,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 235,
"end": 253,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 235,
"end": 249,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 235,
"end": 241,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 242,
"end": 249,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 250,
"end": 253,
"ctxt": 0
},
"value": "Sub",
"optional": false
}
},
"right": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 256,
"end": 339,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 268,
"end": 337,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 268,
"end": 279,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 282,
"end": 337,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 292,
"end": 331,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 292,
"end": 330,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 292,
"end": 305,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 292,
"end": 296,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 297,
"end": 305,
"ctxt": 0
},
"value": "instance",
"optional": false
}
},
"right": {
"type": "NewExpression",
"span": {
"start": 308,
"end": 330,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 312,
"end": 326,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 312,
"end": 318,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 319,
"end": 326,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 327,
"end": 329,
"ctxt": 0
},
"value": 10.0
}
}
],
"typeArguments": null
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
}
],
"interpreter": null
}