mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 19:56:30 +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:
parent
a6fe27423a
commit
2e00731ddb
Notes:
sideshowbarker
2024-07-18 11:07:33 +09:00
Author: https://github.com/alimpfard
Commit: 2e00731ddb
Pull-request: https://github.com/SerenityOS/serenity/pull/8384
2 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue