mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00: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
Notes:
github-actions[bot]
2024-11-25 12:34:34 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/1675f40e296 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2557 Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue