mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +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: https://github.com/SerenityOS/serenity/commit/24430b38609 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)
|
||||
{
|
||||
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);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Reference in a new issue