Commit 4e0b0c65 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] Calls thisBigIntValue in BigInt toLocaleString

Bug: v8:9109
Change-Id: I5a79192c8168c81d8f35711f8983fb1acb260a10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559214Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60731}
parent d54dcce5
......@@ -127,10 +127,17 @@ BUILTIN(BigIntPrototypeToLocaleString) {
HandleScope scope(isolate);
#ifdef V8_INTL_SUPPORT
if (FLAG_harmony_intl_bigint) {
// 1. Let x be ? thisBigIntValue(this value).
Handle<BigInt> x;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, x,
ThisBigIntValue(isolate, args.receiver(),
"BigInt.prototype.toLocaleString"));
RETURN_RESULT_OR_FAILURE(
isolate, Intl::NumberToLocaleString(isolate, args.receiver(),
args.atOrUndefined(isolate, 1),
args.atOrUndefined(isolate, 2)));
isolate,
Intl::NumberToLocaleString(isolate, x, args.atOrUndefined(isolate, 1),
args.atOrUndefined(isolate, 2)));
}
// Fallbacks to old toString implemention if flag is off or no
// V8_INTL_SUPPORT
......
......@@ -60,6 +60,7 @@ FEATURE_FLAGS = {
'export-star-as-namespace-from-module': '--harmony-namespace-exports',
'Object.fromEntries': '--harmony-object-from-entries',
'hashbang': '--harmony-hashbang',
'BigInt': '--harmony-intl-bigint',
}
SKIPPED_FEATURES = set(['class-methods-private',
......
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