mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
LibJS: Disallow async generator functions called 'await' or 'yield'
This commit is contained in:
parent
c8e80690a7
commit
81312986fe
4 changed files with 12 additions and 0 deletions
|
@ -4,6 +4,9 @@ describe("parsing freestanding async functions", () => {
|
|||
// Although it does not create an async function it is valid.
|
||||
expect(`async
|
||||
function foo() {}`).toEval();
|
||||
|
||||
expect(`async function await() {}`).toEval();
|
||||
expect(`async function yield() {}`).toEval();
|
||||
});
|
||||
test("await expression", () => {
|
||||
expect(`async function foo() { await bar(); }`).toEval();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue