Skip to content

Commit 85f88c6

Browse files
targosBethGriggs
authored andcommitted
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: v8/v8@90be99f PR-URL: #46646 Refs: #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>
1 parent b4ebe6d commit 85f88c6

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Reset this number to 0 on major V8 upgrades.
3939
# Increment by one for each non-official patch applied to deps/v8.
40-
'v8_embedder_string': '-node.25',
40+
'v8_embedder_string': '-node.26',
4141

4242
##### V8 defaults for Node.js #####
4343

deps/v8/src/objects/js-date-time-format.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,11 @@ MaybeHandle<String> FormatDateTime(Isolate* isolate,
722722
icu::UnicodeString result;
723723
date_format.format(date_value, result);
724724

725+
// Revert ICU 72 change that introduced U+202F instead of U+0020
726+
// to separate time from AM/PM. See https://crbug.com/1414292.
727+
result = result.findAndReplace(icu::UnicodeString(0x202f),
728+
icu::UnicodeString(0x20));
729+
725730
return Intl::ToString(isolate, result);
726731
}
727732

deps/v8/test/mjsunit/mjsunit.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@
437437

438438
# noi18n is required for Intl
439439
'regress/regress-crbug-1052647': [PASS,FAIL],
440+
441+
# Tests ICU-specific behavior.
442+
'regress/regress-crbug-1414292': [SKIP],
440443
}], # 'no_i18n'
441444

442445
##############################################################################
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2023 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+
const date = new Date("Wed Feb 15 2023 00:00:00 GMT+0100");
6+
const localeString = date.toLocaleString("en-US");
7+
// No narrow-width space should be found
8+
assertEquals(-1, localeString.search('\u202f'));
9+
// Regular space should match the character between time and AM/PM.
10+
assertMatches(/:\d\d:\d\d [AP]M$/, localeString);
11+
12+
const formatter = new Intl.DateTimeFormat('en', {timeStyle: "long"})
13+
const formattedString = formatter.format(date)
14+
// No narrow-width space should be found
15+
assertEquals(-1, formattedString.search('\u202f'));
16+
// Regular space should match the character between time and AM/PM.
17+
assertMatches(/:\d\d:\d\d [AP]M$/, localeString);

deps/v8/test/test262/test262.status

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,10 @@
659659
'language/expressions/assignmenttargettype/direct-callexpression-arguments': [FAIL],
660660
'language/expressions/assignmenttargettype/parenthesized-callexpression-arguments': [FAIL],
661661

662+
# We replace U+202F (narrow-width space) with U+0020 (regular space).
663+
# https://crbug.com/1414292
664+
'intl402/DateTimeFormat/prototype/format/timedatestyle-en': [FAIL],
665+
662666
############################ INVALID TESTS #############################
663667

664668
# Test makes unjustified assumptions about the number of calls to SortCompare.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy