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

140 lines
3.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 61,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 1,
"end": 61,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1,
"end": 60,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1,
"end": 58,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 1,
"end": 55,
"ctxt": 0
},
"callee": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 5,
"end": 53,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 17,
"end": 51,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 17,
"end": 19,
"ctxt": 0
},
"value": "hi",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 17,
"end": 51,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 22,
"end": 51,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 32,
"end": 45,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 39,
"end": 44,
"ctxt": 0
},
"value": "Hi!",
"raw": "\"Hi!\""
}
}
]
},
"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": []
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 56,
"end": 58,
"ctxt": 0
},
"value": "hi",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}