1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +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 generators", () => {
expect(`async function *foo() {}`).toEval();
expect(`async function
*foo() {}`).toEval();
expect(`async function *await() {}`).not.toEval();
expect(`async function *yield() {}`).not.toEval();
});
test("yield & await expression", () => {
expect(`async function* foo() { yield; await 1; }`).toEval();