{ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":40,"index":40}}, "errors": [ "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules. (1:24)" ], "program": { "type": "Program", "start":0,"end":40,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":40,"index":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", "start":0,"end":40,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":40,"index":40}}, "id": { "type": "Identifier", "start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, "async": false, "params": [ { "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13,"index":13},"end":{"line":1,"column":20,"index":20},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "BlockStatement", "start":22,"end":40,"loc":{"start":{"line":1,"column":22,"index":22},"end":{"line":1,"column":40,"index":40}}, "body": [ { "type": "ExpressionStatement", "start":24,"end":38,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":38,"index":38}}, "expression": { "type": "AwaitExpression", "start":24,"end":37,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":37,"index":37}}, "argument": { "type": "Identifier", "start":30,"end":37,"loc":{"start":{"line":1,"column":30,"index":30},"end":{"line":1,"column":37,"index":37},"identifierName":"promise"}, "name": "promise" } } } ], "directives": [] } } ], "directives": [] } }