1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00:00

LibJS: Allow methods in classes named 'async'

Also add tests for all static, setter and getter cases.
This commit is contained in:
davidot 2022-02-17 18:03:41 +01:00 committed by Linus Groh
parent 65bebb5241
commit 2c6183da1e
8 changed files with 85 additions and 1 deletions

View file

@ -73,3 +73,15 @@ test("inherited getter overriding", () => {
expect(new Child().x).toBe(10);
});
test("static getter named 'async'", () => {
class A {
get async() {
return "getter named async";
}
}
const a = new A();
expect("async" in a).toBeTrue();
expect(a.async).toBe("getter named async");
});