Skip to content

Commit 43d1ac3

Browse files
committed
deps: backport bff3074 from V8 upstream
Original commit message: Allow ICU to normalize time zones There's at least one case of a time zone alias: Asia/Kathmandu aliases Asia/Katmandu. ICU seems to normalize to the (deprecated) latter choice. V8 internationalization choked on this change; this patch interprets ICU's output more precisely and allows it. BUG=chromium:487322 R=jungshik,adamk LOG=Y Review URL: https://codereview.chromium.org/1509273007 Cr-Commit-Position: refs/heads/master@{#32769} PR-URL: #15562 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
1 parent e064ae6 commit 43d1ac3

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 103
14-
#define V8_PATCH_LEVEL 51
14+
#define V8_PATCH_LEVEL 52
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/i18n.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
15621562
var formatter = %CreateDateTimeFormat(
15631563
requestedLocale, {skeleton: ldmlString, timeZone: tz}, resolved);
15641564

1565-
if (!IS_UNDEFINED(tz) && tz !== resolved.timeZone) {
1565+
if (resolved.timeZone === "Etc/Unknown") {
15661566
throw MakeRangeError(kUnsupportedTimeZone, tz);
15671567
}
15681568

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2015 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Normalizes Kat{h,}mandu (chromium:487322)
6+
df = new Intl.DateTimeFormat('en-US', {'timeZone': 'Asia/Katmandu'})
7+
assertEquals('Asia/Katmandu', df.resolvedOptions().timeZone);
8+
9+
df = new Intl.DateTimeFormat('en-US', {'timeZone': 'Asia/Kathmandu'})
10+
assertEquals('Asia/Katmandu', df.resolvedOptions().timeZone);
11+
12+
// Throws for unsupported time zones.
13+
assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'Aurope/Paris'}));

0 commit comments

Comments
 (0)