1
Fork 0
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:
Linus Groh 2021-10-03 00:32:43 +01:00
parent b7e5f08e56
commit 1d45541278
18 changed files with 89 additions and 188 deletions

View file

@ -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"));