mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibJS: Convert Object::set() to ThrowCompletionOr
This commit is contained in:
parent
b7e5f08e56
commit
1d45541278
18 changed files with 89 additions and 188 deletions
|
@ -673,9 +673,9 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::scroll_by)
|
|||
} else if (vm.argument_count() >= 2) {
|
||||
// We ignore arguments 2+ in line with behavior of Chrome and Firefox
|
||||
options = JS::Object::create(global_object, nullptr);
|
||||
options->set("left", vm.argument(0), ShouldThrowExceptions::No);
|
||||
options->set("top", vm.argument(1), ShouldThrowExceptions::No);
|
||||
options->set("behavior", JS::js_string(vm, "auto"), ShouldThrowExceptions::No);
|
||||
MUST(options->set("left", vm.argument(0), ShouldThrowExceptions::No));
|
||||
MUST(options->set("top", vm.argument(1), ShouldThrowExceptions::No));
|
||||
MUST(options->set("behavior", JS::js_string(vm, "auto"), ShouldThrowExceptions::No));
|
||||
}
|
||||
|
||||
auto left_value = TRY_OR_DISCARD(options->get("left"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue