1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

LibJS: Convert to_i32() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-17 23:33:35 +03:00
parent 20d990563c
commit f6a5ff7b00
11 changed files with 47 additions and 61 deletions

View file

@ -315,12 +315,7 @@ public:
ThrowCompletionOr<u64> to_bigint_uint64(GlobalObject&) const;
ThrowCompletionOr<double> to_double(GlobalObject&) const;
ThrowCompletionOr<StringOrSymbol> to_property_key(GlobalObject&) const;
i32 to_i32(GlobalObject& global_object) const
{
if (m_type == Type::Int32)
return m_value.as_i32;
return to_i32_slow_case(global_object);
}
ThrowCompletionOr<i32> to_i32(GlobalObject& global_object) const;
u32 to_u32(GlobalObject&) const;
i16 to_i16(GlobalObject&) const;
u16 to_u16(GlobalObject&) const;
@ -356,7 +351,7 @@ private:
[[nodiscard]] ThrowCompletionOr<Value> invoke_internal(GlobalObject& global_object, PropertyName const&, Optional<MarkedValueList> arguments);
i32 to_i32_slow_case(GlobalObject&) const;
ThrowCompletionOr<i32> to_i32_slow_case(GlobalObject&) const;
union {
bool as_bool;