mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +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 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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue