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

388 lines
9.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 271,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 22,
"end": 25,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 16,
"end": 29,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 36,
"end": 47,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"declare": false,
"span": {
"start": 30,
"end": 203,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 54,
"end": 148,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"value": "next",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 54,
"end": 148,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 61,
"end": 148,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 71,
"end": 142,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 78,
"end": 141,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 92,
"end": 97,
"ctxt": 0
},
"value": "value",
"optional": false
},
"value": {
"type": "NewExpression",
"span": {
"start": 99,
"end": 106,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 120,
"end": 124,
"ctxt": 0
},
"value": "done",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 126,
"end": 131,
"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": 153,
"end": 201,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 153,
"end": 170,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 154,
"end": 169,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 161,
"end": 169,
"ctxt": 0
},
"value": "iterator",
"optional": false
}
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 153,
"end": 201,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 173,
"end": 201,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 183,
"end": 195,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 190,
"end": 194,
"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": "ForOfStatement",
"span": {
"start": 205,
"end": 271,
"ctxt": 0
},
"await": false,
"left": {
"type": "VariableDeclaration",
"span": {
"start": 210,
"end": 217,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "NewExpression",
"span": {
"start": 221,
"end": 236,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 225,
"end": 236,
"ctxt": 0
},
"value": "FooIterator",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 238,
"end": 271,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 244,
"end": 256,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 250,
"end": 255,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}