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

68 lines
2.4 KiB
JSON

{
"type": "File",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"errors": [
"SyntaxError: Yield expression is not allowed in formal parameters (1:15)"
],
"program": {
"type": "Program",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"expression": {
"type": "ObjectExpression",
"start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}},
"extra": {
"parenthesized": true,
"parenStart": 0
},
"properties": [
{
"type": "ObjectMethod",
"start":3,"end":24,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":24}},
"method": true,
"key": {
"type": "Identifier",
"start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"method"},
"name": "method"
},
"computed": false,
"kind": "method",
"id": null,
"generator": true,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}},
"left": {
"type": "Identifier",
"start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"},
"name": "x"
},
"right": {
"type": "YieldExpression",
"start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}},
"delegate": false,
"argument": null
}
}
],
"body": {
"type": "BlockStatement",
"start":22,"end":24,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":24}},
"body": [],
"directives": []
}
}
]
}
}
],
"directives": []
}
}