| 1 | { |
| 2 | "type": "File", |
| 3 | "start":0,"end":25,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":25,"index":25}}, |
| 4 | "errors": [ |
| 5 | "SyntaxError: Generators can only be declared at the top level or inside a block. (1:16)" |
| 6 | ], |
| 7 | "program": { |
| 8 | "type": "Program", |
| 9 | "start":0,"end":25,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":25,"index":25}}, |
| 10 | "sourceType": "script", |
| 11 | "interpreter": null, |
| 12 | "body": [ |
| 13 | { |
| 14 | "type": "IfStatement", |
| 15 | "start":0,"end":25,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":25,"index":25}}, |
| 16 | "test": { |
| 17 | "type": "NumericLiteral", |
| 18 | "start":4,"end":5,"loc":{"start":{"line":1,"column":4,"index":4},"end":{"line":1,"column":5,"index":5}}, |
| 19 | "extra": { |
| 20 | "rawValue": 1, |
| 21 | "raw": "1" |
| 22 | }, |
| 23 | "value": 1 |
| 24 | }, |
| 25 | "consequent": { |
| 26 | "type": "FunctionDeclaration", |
| 27 | "start":7,"end":25,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":25,"index":25}}, |
| 28 | "id": { |
| 29 | "type": "Identifier", |
| 30 | "start":17,"end":20,"loc":{"start":{"line":1,"column":17,"index":17},"end":{"line":1,"column":20,"index":20},"identifierName":"foo"}, |
| 31 | "name": "foo" |
| 32 | }, |
| 33 | "generator": true, |
| 34 | "async": false, |
| 35 | "params": [], |
| 36 | "body": { |
| 37 | "type": "BlockStatement", |
| 38 | "start":23,"end":25,"loc":{"start":{"line":1,"column":23,"index":23},"end":{"line":1,"column":25,"index":25}}, |
| 39 | "body": [], |
| 40 | "directives": [] |
| 41 | } |
| 42 | }, |
| 43 | "alternate": null |
| 44 | } |
| 45 | ], |
| 46 | "directives": [] |
| 47 | } |
| 48 | } |