mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibJS: Remove two unnecessary 'vm.argument(0).value_or(js_undefined())'
VM::argument() never returns an empty value.
This commit is contained in:
committed by
Andreas Kling
parent
fdf701ed96
commit
57f7e6e775
@@ -63,7 +63,7 @@ Promise::ResolvingFunctions Promise::create_resolving_functions()
|
||||
return js_undefined();
|
||||
}
|
||||
already_resolved.value = true;
|
||||
auto resolution = vm.argument(0).value_or(js_undefined());
|
||||
auto resolution = vm.argument(0);
|
||||
if (resolution.is_object() && &resolution.as_object() == &promise) {
|
||||
dbgln_if(PROMISE_DEBUG, "[Promise @ {} / PromiseResolvingFunction]: Promise can't be resolved with itself, rejecting with error", &promise);
|
||||
auto* self_resolution_error = TypeError::create(global_object, "Cannot resolve promise with itself");
|
||||
@@ -100,7 +100,7 @@ Promise::ResolvingFunctions Promise::create_resolving_functions()
|
||||
if (already_resolved.value)
|
||||
return js_undefined();
|
||||
already_resolved.value = true;
|
||||
auto reason = vm.argument(0).value_or(js_undefined());
|
||||
auto reason = vm.argument(0);
|
||||
return promise.reject(reason);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user