Commit 2bb21e16 authored by Jungshik Shin's avatar Jungshik Shin Committed by Commit Bot

resolvedTimezone for Etc/UTC should be UTC per Ecma 402

http://unicode.org/cldr/trac/ticket/9943 added a new separate timezone
ID (Etc/UTC) distinct from "Etc/GMT" even though their behavior is
identical. This CLDR change led v8 to violate Ecma 402 requirement that
resolvedOptions().timeZone for DateTimeFormat be "UTC" for "Etc/UTC"
, "Etc/GMT", "GMT" and "UTC".

This CL made v8 compliant to Ecma 402 again.

Bug=v8:6252
TEST=intl/date-format/timezone
Change-Id: Ibe5d3a2a09680ae00de0d73d123a389710c15af0

Change-Id: Ibe5d3a2a09680ae00de0d73d123a389710c15af0
Reviewed-on: https://chromium-review.googlesource.com/496406Reviewed-by: 's avatarDaniel Ehrenberg <littledan@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45114}
parent f47572f3
......@@ -173,7 +173,13 @@ void SetResolvedDateSettings(Isolate* isolate, const icu::Locale& icu_locale,
icu::UnicodeString canonical_time_zone;
icu::TimeZone::getCanonicalID(time_zone, canonical_time_zone, status);
if (U_SUCCESS(status)) {
if (canonical_time_zone == UNICODE_STRING_SIMPLE("Etc/GMT")) {
// In CLDR (http://unicode.org/cldr/trac/ticket/9943), Etc/UTC is made
// a separate timezone ID from Etc/GMT even though they're still the same
// timezone. We'd not have "Etc/GMT" here because we canonicalize it and
// other GMT-variants to "UTC" in intl.js and "UTC" is turned to "Etc/UTC"
// by ICU before getting here.
DCHECK(canonical_time_zone != UNICODE_STRING_SIMPLE("Etc/GMT"));
if (canonical_time_zone == UNICODE_STRING_SIMPLE("Etc/UTC")) {
JSObject::SetProperty(resolved,
factory->NewStringFromStaticChars("timeZone"),
factory->NewStringFromStaticChars("UTC"), SLOPPY)
......
......@@ -29,9 +29,6 @@
[ALWAYS, {
# TODO(jochen): The following test is flaky.
'overrides/caching': [PASS, FAIL],
# BUG(v8:6252).
'date-format/timezone': [PASS, FAIL],
}], # ALWAYS
['variant == wasm_traps', {
......
......@@ -525,10 +525,6 @@
'intl402/NumberFormat/prototype/11.3_a': [FAIL],
'intl402/String/prototype/localeCompare/13.1.1_7': [PASS, FAIL],
# BUG(v8:6252).
'intl402/DateTimeFormat/6.4_a': [FAIL],
'intl402/DateTimeFormat/6.4_c': [FAIL],
##################### DELIBERATE INCOMPATIBILITIES #####################
# https://code.google.com/p/v8/issues/detail?id=4693
......
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