Commit faf8aae9 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[bigint] Flatten strings in StringToBigInt

Turns out that all callers might need this, so instead of burdening them
with checking, make the helper more robust.

Bug: v8:7151
Change-Id: I54270e2b1f5c03b503e2cf202bcbc09fe91aef14
Reviewed-on: https://chromium-review.googlesource.com/804956Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49844}
parent 9a6f4422
......@@ -953,6 +953,7 @@ MaybeHandle<BigInt> BigIntParseInt(Isolate* isolate, Handle<String> string,
}
MaybeHandle<BigInt> StringToBigInt(Isolate* isolate, Handle<String> string) {
string = String::Flatten(string);
BigIntParseIntHelper helper(isolate, string);
return helper.GetResult();
}
......
......@@ -57,7 +57,6 @@ 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);
}
......
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