mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17: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:
parent
65bebb5241
commit
2c6183da1e
8 changed files with 85 additions and 1 deletions
|
@ -106,3 +106,18 @@ test("inherited static setter overriding", () => {
|
|||
c.x = 10;
|
||||
expect(c.x).toBe(30);
|
||||
});
|
||||
|
||||
test("static setter named 'async'", () => {
|
||||
let called = false;
|
||||
class A {
|
||||
set async(value) {
|
||||
called = true;
|
||||
expect(value).toBe("value set on setter named async");
|
||||
}
|
||||
}
|
||||
|
||||
const a = new A();
|
||||
expect("async" in a).toBeTrue();
|
||||
a.async = "value set on setter named async";
|
||||
expect(called).toBeTrue();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue