mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS: Object.setPrototypeOf throws error on too few arguments
This commit is contained in:
parent
79958f4520
commit
24430b3860
Notes:
sideshowbarker
2024-07-19 05:47:40 +09:00
Author: https://github.com/mattco98
Commit: 24430b3860
Pull-request: https://github.com/SerenityOS/serenity/pull/2489
Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -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 {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue