{ "type": "File", "start": 0, "end": 42, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 1 } }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:7)" ], "program": { "type": "Program", "start": 0, "end": 42, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 1 } }, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", "start": 0, "end": 42, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 1 } }, "id": { "type": "Identifier", "start": 10, "end": 12, "loc": { "start": { "line": 1, "column": 10 }, "end": { "line": 1, "column": 12 }, "identifierName": "fn" }, "name": "fn" }, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 15, "end": 42, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 3, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 19, "end": 40, "loc": { "start": { "line": 2, "column": 2 }, "end": { "line": 2, "column": 23 } }, "expression": { "type": "ArrowFunctionExpression", "start": 19, "end": 39, "loc": { "start": { "line": 2, "column": 2 }, "end": { "line": 2, "column": 22 } }, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 20, "end": 32, "loc": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 15 } }, "left": { "type": "Identifier", "start": 20, "end": 21, "loc": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 4 }, "identifierName": "x" }, "name": "x" }, "right": { "type": "YieldExpression", "start": 24, "end": 32, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 15 } }, "delegate": false, "argument": { "type": "Identifier", "start": 30, "end": 32, "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 2, "column": 15 }, "identifierName": "fn" }, "name": "fn" } } } ], "body": { "type": "BlockStatement", "start": 37, "end": 39, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 22 } }, "body": [], "directives": [] } } } ], "directives": [] } } ], "directives": [] } }