Commit 426af6c0 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

Sync w/ fractionalSecondDigits

Sync the implementation with the latest version of https://github.com/tc39/ecma402/pull/347

Bug: v8:10692
Change-Id: I4e2144da9f770607b4d79e7ce32f079dd2eef54c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290627Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68827}
parent c399fdc5
......@@ -1669,8 +1669,10 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
}
}
if (FLAG_harmony_intl_dateformat_fractional_second_digits) {
// Let _value_ be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3,
// *undefined*). The *undefined* is represented by value 0 here.
Maybe<int> maybe_fsd = Intl::GetNumberOption(
isolate, options, factory->fractionalSecondDigits_string(), 0, 3, 0);
isolate, options, factory->fractionalSecondDigits_string(), 1, 3, 0);
MAYBE_RETURN(maybe_fsd, MaybeHandle<JSDateTimeFormat>());
// Convert fractionalSecondDigits to skeleton.
int fsd = maybe_fsd.FromJust();
......
......@@ -4,10 +4,15 @@
// Flags: --harmony_intl_dateformat_fractional_second_digits
assertEquals(
undefined,
(new Intl.DateTimeFormat("en", {fractionalSecondDigits: 0}))
.resolvedOptions().fractionalSecondDigits);
assertThrows(
() => (new Intl.DateTimeFormat("en", {fractionalSecondDigits: 0})),
RangeError,
"fractionalSecondDigits value is out of range.");
assertThrows(
() => (new Intl.DateTimeFormat("en", {fractionalSecondDigits: 4})),
RangeError,
"fractionalSecondDigits value is out of range.");
assertEquals(
1,
......
......@@ -665,6 +665,13 @@
# https://crbug.com/v8/10688
'language/expressions/optional-chaining/eval-optional-call': [FAIL],
# https://github.com/tc39/test262/pull/2697
'intl402/DateTimeFormat/constructor-options-fractionalSecondDigits-valid': [FAIL],
'intl402/DateTimeFormat/prototype/format/fractionalSecondDigits': [FAIL],
'intl402/DateTimeFormat/prototype/formatRange/fractionalSecondDigits': [FAIL],
'intl402/DateTimeFormat/prototype/formatRangeToParts/fractionalSecondDigits': [FAIL],
'intl402/DateTimeFormat/prototype/formatToParts/fractionalSecondDigits': [FAIL],
######################## NEEDS INVESTIGATION ###########################
# https://bugs.chromium.org/p/v8/issues/detail?id=7833
......
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