Files
babel/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json
Huáng Jùnliàng 5b48f40a08 Polish parser errors (#12258)
* polish: update AwaitNotInAsyncFunction message

* polish: update YieldInParameter error message

* Apply suggestions from code review

Co-authored-by: Brian Ng <bng412@gmail.com>

* update test fixtures

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-26 20:55:04 -04:00

61 lines
2.1 KiB
JSON

{
"type": "File",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"errors": [
"SyntaxError: 'await' is only allowed within async functions (1:15)"
],
"program": {
"type": "Program",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"id": {
"type": "Identifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"},
"name": "foo"
},
"generator": false,
"async": false,
"params": [
{
"type": "ObjectPattern",
"start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}},
"properties": [
{
"type": "ObjectProperty",
"start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}},
"extra": {
"shorthand": true
},
"method": false,
"key": {
"type": "Identifier",
"start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"},
"name": "await"
},
"computed": false,
"shorthand": true,
"value": {
"type": "Identifier",
"start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"},
"name": "await"
}
}
]
}
],
"body": {
"type": "BlockStatement",
"start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}},
"body": [],
"directives": []
}
}
],
"directives": []
}
}