mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibJS: Return a GC::Ref from the NumberToBigInt AO
All callers currently handle this without needing any further changes.
This commit is contained in:
parent
39c500ec7c
commit
1675f40e29
|
|
@ -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() });
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user