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

204 lines
4.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 19,
"end": 101,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 19,
"end": 35,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 23,
"end": 34,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 23,
"end": 26,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 26,
"end": 34,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 28,
"end": 34,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 37,
"end": 83,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "StaticBlock",
"span": {
"start": 51,
"end": 81,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 58,
"end": 81,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 68,
"end": 75,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 68,
"end": 75,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 68,
"end": 71,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 74,
"end": 75,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 85,
"end": 101,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 85,
"end": 101,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 85,
"end": 96,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 85,
"end": 92,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 93,
"end": 96,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 97,
"end": 100,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}