mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 11:37:16 +02: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:
committed by
Andreas Kling
parent
a6fe27423a
commit
2e00731ddb
Notes:
sideshowbarker
2024-07-18 11:07:33 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/2e00731ddb6 Pull-request: https://github.com/SerenityOS/serenity/pull/8384
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user