1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 19:47:42 +00:00

LibJS: Object.setPrototypeOf throws error on too few arguments

This commit is contained in:
Matthew Olsson 2020-06-03 14:25:30 -07:00 committed by Andreas Kling
parent 79958f4520
commit 24430b3860

View file

@ -98,7 +98,7 @@ Value ObjectConstructor::get_prototype_of(Interpreter& interpreter)
Value ObjectConstructor::set_prototype_of(Interpreter& interpreter) Value ObjectConstructor::set_prototype_of(Interpreter& interpreter)
{ {
if (interpreter.argument_count() < 2) if (interpreter.argument_count() < 2)
return {}; interpreter.throw_exception<TypeError>("Object.setPrototypeOf requires at least two arguments");
auto* object = interpreter.argument(0).to_object(interpreter); auto* object = interpreter.argument(0).to_object(interpreter);
if (interpreter.exception()) if (interpreter.exception())
return {}; return {};