[bigint] Flatten string in Runtime_BigIntEqualToString
Bug: v8:6791, v8:6995 Change-Id: I79d04d9e8fbe156570875e3ecc2a1a87c9a794ee Reviewed-on: https://chromium-review.googlesource.com/740918 Reviewed-by: Georg Neis <neis@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#48991}
This commit is contained in:
parent
70b1f15e5a
commit
3942370c39
@ -57,6 +57,7 @@ RUNTIME_FUNCTION(Runtime_BigIntEqualToString) {
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(BigInt, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(String, rhs, 1);
|
||||
rhs = String::Flatten(rhs);
|
||||
bool result = BigInt::EqualToString(lhs, rhs);
|
||||
return *isolate->factory()->ToBoolean(result);
|
||||
}
|
||||
|
@ -151,6 +151,8 @@ const six = BigInt(6);
|
||||
assertFalse(one == "a");
|
||||
assertFalse("a" == one);
|
||||
|
||||
assertTrue(zero == "00000000000000" + "0");
|
||||
|
||||
assertTrue(one == {valueOf() { return true }});
|
||||
assertTrue({valueOf() { return true }} == one);
|
||||
assertFalse(two == {valueOf() { return true }});
|
||||
|
Loading…
Reference in New Issue
Block a user