Files
liuxingbaoyuandGitHub 5b9e724df1 Add allowYieldOutsideFunction to parser (#17149)
* allowYieldOutsideFunction

* dts

* review

* template

* Revert "template"

This reverts commit 324e0893f51b5c8dd2c9f546e0cd3cc4441c5b56.

* improve error

* review
2025-03-21 11:19:58 +01:00

35 lines
1.1 KiB
JSON

{
"type": "File",
"start":0,"end":8,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":8,"index":8}},
"errors": [
"SyntaxError: 'yield' is only allowed within generator functions. (1:0)"
],
"program": {
"type": "Program",
"start":0,"end":8,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":8,"index":8}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":8,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":8,"index":8}},
"expression": {
"type": "YieldExpression",
"start":0,"end":8,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":8,"index":8}},
"delegate": false,
"argument": {
"type": "NumericLiteral",
"start":6,"end":8,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":8,"index":8}},
"extra": {
"rawValue": 10,
"raw": "10"
},
"value": 10
}
}
}
],
"directives": []
}
}