{ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}}, "errors": [ "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement. (1:10)" ], "program": { "type": "Program", "start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", "start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}}, "test": { "type": "NumericLiteral", "start":7,"end":8,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":8,"index":8}}, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "body": { "type": "FunctionDeclaration", "start":10,"end":28,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":28,"index":28}}, "id": { "type": "Identifier", "start":20,"end":23,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":23,"index":23},"identifierName":"foo"}, "name": "foo" }, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", "start":26,"end":28,"loc":{"start":{"line":1,"column":26,"index":26},"end":{"line":1,"column":28,"index":28}}, "body": [], "directives": [] } } } ], "directives": [] } }