From 24430b386094ae6f1a6772e08d08de4b1f4a878e Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Wed, 3 Jun 2020 14:25:30 -0700 Subject: [PATCH] LibJS: Object.setPrototypeOf throws error on too few arguments --- Libraries/LibJS/Runtime/ObjectConstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Libraries/LibJS/Runtime/ObjectConstructor.cpp index 244791cacd..cd8ec2c7a8 100644 --- a/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -98,7 +98,7 @@ Value ObjectConstructor::get_prototype_of(Interpreter& interpreter) Value ObjectConstructor::set_prototype_of(Interpreter& interpreter) { if (interpreter.argument_count() < 2) - return {}; + interpreter.throw_exception("Object.setPrototypeOf requires at least two arguments"); auto* object = interpreter.argument(0).to_object(interpreter); if (interpreter.exception()) return {};