diff --git a/common.gypi b/common.gypi index 0121084a433823..d713ad5586a349 100644 --- a/common.gypi +++ b/common.gypi @@ -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 ##### diff --git a/deps/v8/src/objects/js-date-time-format.cc b/deps/v8/src/objects/js-date-time-format.cc index 7e2ece76a91181..771e67d1c3c3a1 100644 --- a/deps/v8/src/objects/js-date-time-format.cc +++ b/deps/v8/src/objects/js-date-time-format.cc @@ -722,6 +722,11 @@ MaybeHandle 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); } diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index 4e4e5ec61bc5a8..9f152de947e25b 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -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' ############################################################################## diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-1414292.js b/deps/v8/test/mjsunit/regress/regress-crbug-1414292.js new file mode 100644 index 00000000000000..3a0831c67f6acc --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-1414292.js @@ -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); diff --git a/deps/v8/test/test262/test262.status b/deps/v8/test/test262/test262.status index 61c6339330d17a..662e8a3939e3eb 100644 --- a/deps/v8/test/test262/test262.status +++ b/deps/v8/test/test262/test262.status @@ -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.