1
Fork 0
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:
davidot 2021-12-19 20:19:15 +01:00 committed by Linus Groh
parent c8e80690a7
commit 81312986fe
4 changed files with 12 additions and 0 deletions

View file

@ -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();