mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Parse generator functions in class expressions too
This commit is contained in:
committed by
Andreas Kling
parent
609a0aa75d
commit
46ef333e9c
Notes:
sideshowbarker
2024-07-18 11:07:48 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/46ef333e9cd Pull-request: https://github.com/SerenityOS/serenity/pull/8384
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user