mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibJS: Make Value::to_string_without_side_effects() infallible
Work towards #20449.
This commit is contained in:
@@ -153,7 +153,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from)
|
||||
if (!mapfn_value.is_undefined()) {
|
||||
// a. If IsCallable(mapfn) is false, throw a TypeError exception.
|
||||
if (!mapfn_value.is_function())
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, TRY_OR_THROW_OOM(vm, mapfn_value.to_string_without_side_effects()));
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, mapfn_value.to_string_without_side_effects());
|
||||
|
||||
// b. Let mapping be true.
|
||||
mapfn = &mapfn_value.as_function();
|
||||
@@ -318,7 +318,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from_async)
|
||||
else {
|
||||
// i. If IsCallable(mapfn) is false, throw a TypeError exception.
|
||||
if (!mapfn.is_function())
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, TRY_OR_THROW_OOM(vm, mapfn.to_string_without_side_effects()));
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, mapfn.to_string_without_side_effects());
|
||||
|
||||
// ii. Let mapping be true.
|
||||
mapping = true;
|
||||
|
||||
Reference in New Issue
Block a user