commit 28ccbb1d46415df434b756b7bb24964fb1c82f9a
parent 98782f1d9cd9fab1fcc91e90f9f42ad0288735db
Author: Tooru Fujisawa <arai_a@mac.com>
Date: Wed, 12 Nov 2025 09:05:12 +0000
Bug 1999551 - Part 3: Remove unused BigInt::looselyEqual. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D272197
Diffstat:
2 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/js/src/vm/BigIntType.cpp b/js/src/vm/BigIntType.cpp
@@ -3662,42 +3662,6 @@ JS::Result<bool> BigInt::equal(JSContext* cx, Handle<BigInt*> lhs,
return equal(lhs, rhsBigInt);
}
-// BigInt proposal section 3.2.5
-JS::Result<bool> BigInt::looselyEqual(JSContext* cx, HandleBigInt lhs,
- HandleValue rhs) {
- // Step 1.
- if (rhs.isBigInt()) {
- return equal(lhs, rhs.toBigInt());
- }
-
- // Steps 2-5 (not applicable).
-
- // Steps 6-7.
- if (rhs.isString()) {
- RootedString rhsString(cx, rhs.toString());
- return equal(cx, lhs, rhsString);
- }
-
- // Steps 8-9 (not applicable).
-
- // Steps 10-11.
- if (rhs.isObject()) {
- RootedValue rhsPrimitive(cx, rhs);
- if (!ToPrimitive(cx, &rhsPrimitive)) {
- return cx->alreadyReportedError();
- }
- return looselyEqual(cx, lhs, rhsPrimitive);
- }
-
- // Step 12.
- if (rhs.isNumber()) {
- return equal(lhs, rhs.toNumber());
- }
-
- // Step 13.
- return false;
-}
-
// BigInt proposal section 1.1.12. BigInt::lessThan ( x, y )
bool BigInt::lessThan(const BigInt* x, const BigInt* y) {
return compare(x, y) < 0;
diff --git a/js/src/vm/BigIntType.h b/js/src/vm/BigIntType.h
@@ -253,8 +253,6 @@ class BigInt final : public js::gc::CellWithLengthAndFlags {
static bool equal(const BigInt* lhs, double rhs);
static JS::Result<bool> equal(JSContext* cx, Handle<BigInt*> lhs,
HandleString rhs);
- static JS::Result<bool> looselyEqual(JSContext* cx, Handle<BigInt*> lhs,
- HandleValue rhs);
static bool lessThan(const BigInt* x, const BigInt* y);
// These methods return Nothing when the non-BigInt operand is NaN