mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
LibJS: Allow methods in classes named 'async'
Also add tests for all static, setter and getter cases.
This commit is contained in:
parent
65bebb5241
commit
2c6183da1e
Notes:
sideshowbarker
2024-07-17 18:35:25 +09:00
Author: https://github.com/davidot
Commit: 2c6183da1e
Pull-request: https://github.com/SerenityOS/serenity/pull/12613
Issue: https://github.com/SerenityOS/serenity/issues/12583
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/linusg
8 changed files with 85 additions and 1 deletions
|
@ -70,3 +70,14 @@ test("static method overriding", () => {
|
|||
expect(Parent.method()).toBe(3);
|
||||
expect(Child.method()).toBe(10);
|
||||
});
|
||||
|
||||
test("static function named 'async'", () => {
|
||||
class A {
|
||||
static async() {
|
||||
return "static function named async";
|
||||
}
|
||||
}
|
||||
|
||||
expect("async" in A).toBeTrue();
|
||||
expect(A.async()).toBe("static function named async");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue