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

144 lines
3.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 60,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 0,
"end": 60,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 0,
"end": 59,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 0,
"end": 57,
"ctxt": 0
},
"object": {
"type": "NewExpression",
"span": {
"start": 0,
"end": 54,
"ctxt": 0
},
"callee": {
"type": "ClassExpression",
"identifier": null,
"span": {
"start": 4,
"end": 52,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 16,
"end": 50,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 16,
"end": 18,
"ctxt": 0
},
"value": "hi",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 16,
"end": 50,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 21,
"end": 50,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 31,
"end": 44,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 38,
"end": 43,
"ctxt": 0
},
"value": "Hi!",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"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": 55,
"end": 57,
"ctxt": 0
},
"value": "hi",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}