summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-10-15 00:12:28 +0100
committerLinus Groh <mail@linusgroh.de>2021-10-15 09:36:21 +0100
commitfb85fd4867d044bd9f6894dc4fd49ab4aeedf4f3 (patch)
treee6a94714e12cf3e746912d3b88f6f2901f840a60 /Userland
parent09536f5f48b7459f04200f1dc6d10220ab53fed8 (diff)
downloadserenity-fb85fd4867d044bd9f6894dc4fd49ab4aeedf4f3.zip
LibJS/Tests: Test ShadowRealm.prototype.evaluate() this value type check
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/ShadowRealm/ShadowRealm.prototype.evaluate.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/ShadowRealm/ShadowRealm.prototype.evaluate.js b/Userland/Libraries/LibJS/Tests/builtins/ShadowRealm/ShadowRealm.prototype.evaluate.js
index 8f01cec94f..d301b4e5eb 100644
--- a/Userland/Libraries/LibJS/Tests/builtins/ShadowRealm/ShadowRealm.prototype.evaluate.js
+++ b/Userland/Libraries/LibJS/Tests/builtins/ShadowRealm/ShadowRealm.prototype.evaluate.js
@@ -56,6 +56,12 @@ describe("normal behavior", () => {
});
describe("errors", () => {
+ test("this value must be a ShadowRealm object", () => {
+ expect(() => {
+ ShadowRealm.prototype.evaluate.call("foo");
+ }).toThrowWithMessage(TypeError, "Not an object of type ShadowRealm");
+ });
+
test("throws for non-string input", () => {
const shadowRealm = new ShadowRealm();
const values = [