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

287 lines
6.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 104,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 16,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 7,
"end": 15,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 7,
"end": 10,
"ctxt": 0
},
"value": "arr",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 13,
"end": 15,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "ForStatement",
"span": {
"start": 17,
"end": 104,
"ctxt": 0
},
"init": {
"type": "VariableDeclaration",
"span": {
"start": 22,
"end": 31,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 26,
"end": 31,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"definite": false
}
]
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 33,
"end": 39,
"ctxt": 0
},
"operator": "<",
"left": {
"type": "Identifier",
"span": {
"start": 33,
"end": 34,
"ctxt": 0
},
"value": "i",
"optional": false
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 37,
"end": 39,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
"update": {
"type": "UpdateExpression",
"span": {
"start": 41,
"end": 44,
"ctxt": 0
},
"operator": "++",
"prefix": true,
"argument": {
"type": "Identifier",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"body": {
"type": "BlockStatement",
"span": {
"start": 46,
"end": 104,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 52,
"end": 85,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 70,
"end": 79,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "prop",
"optional": false
},
"value": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "i",
"optional": false
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 90,
"end": 102,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 90,
"end": 101,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 90,
"end": 98,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"value": "arr",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 94,
"end": 98,
"ctxt": 0
},
"value": "push",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "C",
"optional": false
}
}
],
"typeArguments": null
}
}
]
}
}
],
"interpreter": null
}