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

236 lines
5.6 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 102,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 20,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 20,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": "C",
"optional": false
},
"span": {
"start": 9,
"end": 20,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 22,
"end": 59,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 26,
"end": 59,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 30,
"end": 59,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"value": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 47,
"end": 49,
"ctxt": 0
},
"value": "C2",
"optional": false
},
"span": {
"start": 41,
"end": 57,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
]
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 61,
"end": 102,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 70,
"end": 102,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 76,
"end": 100,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 80,
"end": 100,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"value": "C4",
"optional": false
},
"span": {
"start": 84,
"end": 100,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}