mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
deps: V8: cherry-pick 90be99fab31c
Original commit message:
[intl] Revert date formatting behavior change from ICU 72
Replace U+202F with U+0020 after formatting date. This lets websites
continue to work without any changes.
This matches Firefox behavior, according to
https://bugzilla.mozilla.org/show_bug.cgi?id=1806042#c17.
Bug: chromium:1414292, chromium:1401829, chromium:1392814
Change-Id: I7c2b58414d0890f8705e737f903403dc54e5fe57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4237675
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85757}
Refs: https://github.com/v8/v8/commit/90be99fab31c8299568e4114be1f0abd3741d615
PR-URL: https://github.com/nodejs/node/pull/46646
Refs: https://github.com/nodejs/node/issues/46123
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
b4ebe6d47b
commit
85f88c6a8d
5 files changed
+30
-1
No files matched your search
+1
-1
@@ -37,7 +37,7 @@
|
||||
|
||||
# Reset this number to 0 on major V8 upgrades.
|
||||
# Increment by one for each non-official patch applied to deps/v8.
|
||||
'v8_embedder_string': '-node.25',
|
||||
'v8_embedder_string': '-node.26',
|
||||
|
||||
##### V8 defaults for Node.js #####
|
||||
|
||||
|
||||
+5
@@ -722,6 +722,11 @@ MaybeHandle<String> FormatDateTime(Isolate* isolate,
|
||||
icu::UnicodeString result;
|
||||
date_format.format(date_value, result);
|
||||
|
||||
// Revert ICU 72 change that introduced U+202F instead of U+0020
|
||||
// to separate time from AM/PM. See https://crbug.com/1414292.
|
||||
result = result.findAndReplace(icu::UnicodeString(0x202f),
|
||||
icu::UnicodeString(0x20));
|
||||
|
||||
return Intl::ToString(isolate, result);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
@@ -437,6 +437,9 @@
|
||||
|
||||
# noi18n is required for Intl
|
||||
'regress/regress-crbug-1052647': [PASS,FAIL],
|
||||
|
||||
# Tests ICU-specific behavior.
|
||||
'regress/regress-crbug-1414292': [SKIP],
|
||||
}], # 'no_i18n'
|
||||
|
||||
##############################################################################
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright 2023 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.
|
||||
|
||||
const date = new Date("Wed Feb 15 2023 00:00:00 GMT+0100");
|
||||
const localeString = date.toLocaleString("en-US");
|
||||
// No narrow-width space should be found
|
||||
assertEquals(-1, localeString.search('\u202f'));
|
||||
// Regular space should match the character between time and AM/PM.
|
||||
assertMatches(/:\d\d:\d\d [AP]M$/, localeString);
|
||||
|
||||
const formatter = new Intl.DateTimeFormat('en', {timeStyle: "long"})
|
||||
const formattedString = formatter.format(date)
|
||||
// No narrow-width space should be found
|
||||
assertEquals(-1, formattedString.search('\u202f'));
|
||||
// Regular space should match the character between time and AM/PM.
|
||||
assertMatches(/:\d\d:\d\d [AP]M$/, localeString);
|
||||
Vendored
+4
@@ -659,6 +659,10 @@
|
||||
'language/expressions/assignmenttargettype/direct-callexpression-arguments': [FAIL],
|
||||
'language/expressions/assignmenttargettype/parenthesized-callexpression-arguments': [FAIL],
|
||||
|
||||
# We replace U+202F (narrow-width space) with U+0020 (regular space).
|
||||
# https://crbug.com/1414292
|
||||
'intl402/DateTimeFormat/prototype/format/timedatestyle-en': [FAIL],
|
||||
|
||||
############################ INVALID TESTS #############################
|
||||
|
||||
# Test makes unjustified assumptions about the number of calls to SortCompare.
|
||||
|
||||
Reference in new issue
Block a user