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:
parent
a6fe27423a
commit
2e00731ddb
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