diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/classes/class-methods.js')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/classes/class-methods.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/classes/class-methods.js b/Userland/Libraries/LibJS/Tests/classes/class-methods.js index 0add75635c..d300c555fe 100644 --- a/Userland/Libraries/LibJS/Tests/classes/class-methods.js +++ b/Userland/Libraries/LibJS/Tests/classes/class-methods.js @@ -49,3 +49,15 @@ test("extended name syntax", () => { expect(a[12]()).toBe(2); expect(a.hello()).toBe(3); }); + +test("method named 'async'", () => { + class A { + async() { + return "function named async"; + } + } + + const a = new A(); + expect("async" in a).toBeTrue(); + expect(a.async()).toBe("function named async"); +}); |