mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
LibJS: Parse generator functions in class expressions too
This commit is contained in:
parent
609a0aa75d
commit
46ef333e9c
2 changed files with 29 additions and 3 deletions
|
@ -39,3 +39,13 @@ describe("parsing object literal generator functions", () => {
|
|||
foo() { yield (yield); } }`).toEval();
|
||||
});
|
||||
});
|
||||
|
||||
describe("parsing classes with generator methods", () => {
|
||||
test("simple", () => {
|
||||
expect(`class Foo { *foo() {} }`).toEval();
|
||||
expect(`class Foo { static *foo() {} }`).toEval();
|
||||
expect(`class Foo { *foo() { yield; } }`).toEval();
|
||||
expect(`class Foo { *foo() { yield 42; } }`).toEval();
|
||||
expect(`class Foo { *constructor() { yield 42; } }`).not.toEval();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue