Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
MylesBorins committed Oct 11, 2017
commit 82b243600c3f11e281e9e66584e719c9276208dc
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 103
#define V8_PATCH_LEVEL 51
#define V8_PATCH_LEVEL 52

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ function initializeDateTimeFormat(dateFormat, locales, options) {
var formatter = %CreateDateTimeFormat(
requestedLocale, {skeleton: ldmlString, timeZone: tz}, resolved);

if (!IS_UNDEFINED(tz) && tz !== resolved.timeZone) {
if (resolved.timeZone === "Etc/Unknown") {
throw MakeRangeError(kUnsupportedTimeZone, tz);
}

Expand Down
13 changes: 13 additions & 0 deletions deps/v8/test/mjsunit/regress/regress-487322.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Normalizes Kat{h,}mandu (chromium:487322)
df = new Intl.DateTimeFormat('en-US', {'timeZone': 'Asia/Katmandu'})
assertEquals('Asia/Katmandu', df.resolvedOptions().timeZone);

df = new Intl.DateTimeFormat('en-US', {'timeZone': 'Asia/Kathmandu'})
assertEquals('Asia/Katmandu', df.resolvedOptions().timeZone);

// Throws for unsupported time zones.
assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'Aurope/Paris'}));