summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyles Borins <mylesborins@google.com>2017-09-22 14:32:21 -0400
committerMyles Borins <myles.borins@gmail.com>2017-10-25 04:25:42 -0400
commit43d1ac3a621c54350537f99809de9338e3fa9033 (patch)
tree6cb9142ac210420087bedf38b63c7f17f614e368
parente064ae62e440b4a45d20e13388398f9086039d62 (diff)
downloadnode-new-43d1ac3a621c54350537f99809de9338e3fa9033.tar.gz
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: https://github.com/nodejs/node/pull/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>
-rw-r--r--deps/v8/include/v8-version.h2
-rw-r--r--deps/v8/src/i18n.js2
-rw-r--r--deps/v8/test/mjsunit/regress/regress-487322.js13
3 files changed, 15 insertions, 2 deletions
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index 20282039be..88682a0fa5 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -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.)
diff --git a/deps/v8/src/i18n.js b/deps/v8/src/i18n.js
index 79e988062e..c6675679dc 100644
--- a/deps/v8/src/i18n.js
+++ b/deps/v8/src/i18n.js
@@ -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);
}
diff --git a/deps/v8/test/mjsunit/regress/regress-487322.js b/deps/v8/test/mjsunit/regress/regress-487322.js
new file mode 100644
index 0000000000..ae6da80e44
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-487322.js
@@ -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'}));