mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibJS: Make Value::to_string_without_side_effects() infallible
Work towards #20449.
This commit is contained in:
parent
b8f78c0adc
commit
97ebfd9f0f
69 changed files with 182 additions and 182 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue