diff options
author | Linus Groh <mail@linusgroh.de> | 2021-11-14 01:01:08 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-14 15:27:46 +0000 |
commit | 194d90dc7287270594a6adb16547fc4d668732f7 (patch) | |
tree | cfbd6a39a7d9233251651b6928d257bc8373b16d /Userland/Libraries/LibJS/Tests/builtins | |
parent | 53ec432e8d4f504d04d2d9cd38e459c976dde5c1 (diff) | |
download | serenity-194d90dc7287270594a6adb16547fc4d668732f7.zip |
LibJS: Don't coerce this value to object in Promise.prototype.finally()
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Promise/Promise.prototype.finally.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Promise/Promise.prototype.finally.js b/Userland/Libraries/LibJS/Tests/builtins/Promise/Promise.prototype.finally.js index cdb7a09029..a062b44590 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Promise/Promise.prototype.finally.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Promise/Promise.prototype.finally.js @@ -52,3 +52,11 @@ describe("normal behavior", () => { expect(thenFinallyArg).not.toBe(catchFinallyArg); }); }); + +describe("errors", () => { + test("this value must be an object", () => { + expect(() => { + Promise.prototype.finally.call("foo"); + }).toThrowWithMessage(TypeError, "foo is not an object"); + }); +}); |