LibJS: Return a GC::Ref from the NumberToBigInt AO

All callers currently handle this without needing any further changes.
This commit is contained in:
Timothy Flynn 2024-11-24 09:50:02 -05:00 committed by Andreas Kling
parent 39c500ec7c
commit 1675f40e29
Notes: github-actions[bot] 2024-11-25 12:34:34 +00:00
2 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,7 @@ ErrorOr<String> BigInt::to_string() const
}
// 21.2.1.1.1 NumberToBigInt ( number ), https://tc39.es/ecma262/#sec-numbertobigint
ThrowCompletionOr<BigInt*> number_to_bigint(VM& vm, Value number)
ThrowCompletionOr<GC::Ref<BigInt>> number_to_bigint(VM& vm, Value number)
{
VERIFY(number.is_number());
@ -39,7 +39,7 @@ ThrowCompletionOr<BigInt*> number_to_bigint(VM& vm, Value number)
return vm.throw_completion<RangeError>(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() });
}
}

View file

@ -35,6 +35,6 @@ private:
Crypto::SignedBigInteger m_big_integer;
};
ThrowCompletionOr<BigInt*> number_to_bigint(VM&, Value);
ThrowCompletionOr<GC::Ref<BigInt>> number_to_bigint(VM&, Value);
}