[Intl] Calls thisBigIntValue in BigInt toLocaleString

Bug: v8:9109
Change-Id: I5a79192c8168c81d8f35711f8983fb1acb260a10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559214
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60731}
This commit is contained in:
Frank Tang 2019-04-09 15:05:49 -07:00 committed by Commit Bot
parent d54dcce51d
commit 4e0b0c6544
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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',