diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index 2ebc35770c9..8aee4a348b4 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/Userland/Libraries/LibJS/Heap/Handle.h @@ -53,6 +53,9 @@ public: bool is_null() const { return m_impl.is_null(); } + T* operator->() { return cell(); } + T const* operator->() const { return cell(); } + private: explicit Handle(NonnullRefPtr impl) : m_impl(move(impl)) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp index 4b887bc92b4..e140c9831d0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp @@ -388,7 +388,7 @@ ThrowCompletionOr balance_duration(GlobalObject& global_object days = result.days; // c. Set nanoseconds to result.[[Nanoseconds]]. - total_nanoseconds = result.nanoseconds.cell()->big_integer(); + total_nanoseconds = result.nanoseconds->big_integer(); } // 5. Else, else { @@ -1238,7 +1238,7 @@ ThrowCompletionOr round_duration(GlobalObject& global_object, d auto result = TRY(nanoseconds_to_days(global_object, *nanoseconds_bigint, intermediate)); // e. Set days to days + result.[[Days]] + result.[[Nanoseconds]] / result.[[DayLength]]. - auto nanoseconds_division_result = result.nanoseconds.cell()->big_integer().divided_by(Crypto::UnsignedBigInteger::create_from((u64)result.day_length)); + auto nanoseconds_division_result = result.nanoseconds->big_integer().divided_by(Crypto::UnsignedBigInteger::create_from((u64)result.day_length)); days += result.days + nanoseconds_division_result.quotient.to_double() + nanoseconds_division_result.remainder.to_double() / result.day_length; // f. Set hours, minutes, seconds, milliseconds, microseconds, and nanoseconds to 0.