LibJS: Convert Object::set() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 00:32:43 +01:00
commit 1d45541278
Notes: sideshowbarker 2024-07-18 03:07:37 +09:00
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"));