1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

LibJS: Allow 'yield' and 'await' as function expression names

The spec says so, and test262 checks for this too.
This commit is contained in:
Ali Mohammad Pur 2021-07-02 15:11:11 +04:30 committed by Andreas Kling
parent a6fe27423a
commit 2e00731ddb
2 changed files with 8 additions and 0 deletions

View file

@ -49,3 +49,8 @@ describe("parsing classes with generator methods", () => {
expect(`class Foo { *constructor() { yield 42; } }`).not.toEval();
});
});
test("function expression names equal to 'yield'", () => {
expect(`function *foo() { (function yield() {}); }`).toEval();
expect(`function *foo() { function yield() {} }`).not.toEval();
});