swc/crates/swc_ecma_parser/tests/tsc/for-of17.json
2023-03-12 04:50:28 +00:00

336 lines
8.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 236,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 36,
"ctxt": 0
},
"value": "NumberIterator",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 186,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 43,
"end": 131,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 43,
"end": 47,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 131,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 50,
"end": 131,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 60,
"end": 125,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 67,
"end": 124,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 81,
"end": 86,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 103,
"end": 107,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 109,
"end": 114,
"ctxt": 0
},
"value": false
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 136,
"end": 184,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 136,
"end": 153,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 152,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 137,
"end": 143,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 136,
"end": 184,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 156,
"end": 184,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 166,
"end": 178,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 173,
"end": 177,
"ctxt": 0
}
}
}
]
},
"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": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 188,
"end": 202,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 192,
"end": 201,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 193,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForOfStatement",
"span": {
"start": 203,
"end": 236,
"ctxt": 0
},
"await": false,
"left": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 213,
"end": 231,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 217,
"end": 231,
"ctxt": 0
},
"value": "NumberIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 233,
"end": 236,
"ctxt": 0
},
"stmts": []
}
}
],
"interpreter": null
}