Commit a80e5c5b authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[bigint] Adapt Object::StrictEquals.

R=jkummerow@chromium.org

Bug: v8:6791
Change-Id: I7e99a8aa2aa65e78a8d4288f496d496600063bfe
Reviewed-on: https://chromium-review.googlesource.com/712534
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48485}
parent bfd10baf
......@@ -623,6 +623,9 @@ bool Object::StrictEquals(Object* that) {
} else if (this->IsString()) {
if (!that->IsString()) return false;
return String::cast(this)->Equals(String::cast(that));
} else if (this->IsBigInt()) {
if (!that->IsBigInt()) return false;
return BigInt::Equal(BigInt::cast(this), BigInt::cast(that));
}
return this == that;
}
......
......@@ -260,6 +260,22 @@ const six = BigInt(6);
assertTrue(zero !== 0);
assertFalse(0 === zero);
assertTrue(0 !== zero);
}{
assertTrue(%StrictEqual(zero, zero));
assertFalse(%StrictNotEqual(zero, zero));
assertTrue(%StrictEqual(zero, another_zero));
assertFalse(%StrictNotEqual(zero, another_zero));
assertFalse(%StrictEqual(zero, one));
assertTrue(%StrictNotEqual(zero, one));
assertTrue(%StrictNotEqual(one, zero));
assertFalse(%StrictEqual(one, zero));
assertFalse(%StrictEqual(zero, 0));
assertTrue(%StrictNotEqual(zero, 0));
assertFalse(%StrictEqual(0, zero));
assertTrue(%StrictNotEqual(0, zero));
}
// SameValue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment