From 1675f40e296efaf613e6a4b673dcb609f65166ef Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 24 Nov 2024 09:50:02 -0500 Subject: [PATCH] LibJS: Return a GC::Ref from the NumberToBigInt AO All callers currently handle this without needing any further changes. --- Libraries/LibJS/Runtime/BigInt.cpp | 4 ++-- Libraries/LibJS/Runtime/BigInt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibJS/Runtime/BigInt.cpp b/Libraries/LibJS/Runtime/BigInt.cpp index 4e01b4117a..30620c2785 100644 --- a/Libraries/LibJS/Runtime/BigInt.cpp +++ b/Libraries/LibJS/Runtime/BigInt.cpp @@ -30,7 +30,7 @@ ErrorOr BigInt::to_string() const } // 21.2.1.1.1 NumberToBigInt ( number ), https://tc39.es/ecma262/#sec-numbertobigint -ThrowCompletionOr number_to_bigint(VM& vm, Value number) +ThrowCompletionOr> number_to_bigint(VM& vm, Value number) { VERIFY(number.is_number()); @@ -39,7 +39,7 @@ ThrowCompletionOr number_to_bigint(VM& vm, Value number) return vm.throw_completion(ErrorType::BigIntFromNonIntegral); // 2. Return the BigInt value that represents ℝ(number). - return BigInt::create(vm, Crypto::SignedBigInteger { number.as_double() }).ptr(); + return BigInt::create(vm, Crypto::SignedBigInteger { number.as_double() }); } } diff --git a/Libraries/LibJS/Runtime/BigInt.h b/Libraries/LibJS/Runtime/BigInt.h index 50e6ff60b2..32fc97002b 100644 --- a/Libraries/LibJS/Runtime/BigInt.h +++ b/Libraries/LibJS/Runtime/BigInt.h @@ -35,6 +35,6 @@ private: Crypto::SignedBigInteger m_big_integer; }; -ThrowCompletionOr number_to_bigint(VM&, Value); +ThrowCompletionOr> number_to_bigint(VM&, Value); }