1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +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

@ -110,3 +110,17 @@ describe("errors", () => {
}`).not.toEval();
});
});
test("static setter named 'async'", () => {
let called = false;
class A {
static set async(value) {
called = true;
expect(value).toBe("value set on static setter named async");
}
}
expect("async" in A).toBeTrue();
A.async = "value set on static setter named async";
expect(called).toBeTrue();
});