mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibJS: Convert to_primitive_string() to ThrowCompletionOr
This commit is contained in:
parent
da59c77fe3
commit
96ab116f0d
8 changed files with 18 additions and 30 deletions
|
@ -87,9 +87,7 @@ String JSONObject::stringify_impl(GlobalObject& global_object, Value value, Valu
|
|||
if (vm.exception())
|
||||
return {};
|
||||
} else if (is<StringObject>(space_object)) {
|
||||
space = space.to_primitive_string(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
space = TRY_OR_DISCARD(space.to_primitive_string(global_object));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,9 +155,7 @@ String JSONObject::serialize_json_property(GlobalObject& global_object, Stringif
|
|||
if (vm.exception())
|
||||
return {};
|
||||
} else if (is<StringObject>(value_object)) {
|
||||
value = value.to_primitive_string(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
value = TRY_OR_DISCARD(value.to_primitive_string(global_object));
|
||||
} else if (is<BooleanObject>(value_object)) {
|
||||
value = static_cast<BooleanObject&>(value_object).value_of();
|
||||
} else if (is<BigIntObject>(value_object)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue