GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: V8: cherry-pick 53588faba3ed · nodejs/node@b0f6cf7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • src/regexp
      • regexp-macro-assembler.cc
    • test/mjsunit/regress
      • regress-crbug-562108903.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# Reset this number to 0 on major V8 upgrades.
5252
# Increment by one for each non-official patch applied to deps/v8.
53-
'v8_embedder_string': '-node.52',
53+
'v8_embedder_string': '-node.53',
5454

5555
##### V8 defaults for Node.js #####
5656

Collapse file

‎deps/v8/src/regexp/regexp-macro-assembler.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/regexp/regexp-macro-assembler.cc
+20-6Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifdef V8_INTL_SUPPORT
1616
#include "unicode/uchar.h"
17-
#include "unicode/unistr.h"
17+
#include "unicode/utf16.h"
1818
#endif // V8_INTL_SUPPORT
1919

2020
namespace v8 {
@@ -83,11 +83,25 @@ int RegExpMacroAssembler::CaseInsensitiveCompareUnicode(Address byte_offset1,
8383
DCHECK_EQ(0, byte_length % 2);
8484

8585
#ifdef V8_INTL_SUPPORT
86-
int32_t length = static_cast<int32_t>(byte_length >> 1);
87-
icu::UnicodeString uni_str_1(reinterpret_cast<const char16_t*>(byte_offset1),
88-
length);
89-
return uni_str_1.caseCompare(reinterpret_cast<const char16_t*>(byte_offset2),
90-
length, U_FOLD_CASE_DEFAULT) == 0;
86+
// Canonicalize (ECMA-262 22.2.2.9.2) applies the simple case folding of
87+
// each code point separately.
88+
const int32_t length = static_cast<int32_t>(byte_length >> 1);
89+
const char16_t* str1 = reinterpret_cast<const char16_t*>(byte_offset1);
90+
const char16_t* str2 = reinterpret_cast<const char16_t*>(byte_offset2);
91+
int32_t i1 = 0;
92+
int32_t i2 = 0;
93+
while (i1 < length) {
94+
UChar32 c1, c2;
95+
U16_NEXT(str1, i1, length, c1);
96+
U16_NEXT(str2, i2, length, c2);
97+
if (i1 != i2) return 0;
98+
if (c1 == c2) continue;
99+
if (u_foldCase(c1, U_FOLD_CASE_DEFAULT) !=
100+
u_foldCase(c2, U_FOLD_CASE_DEFAULT)) {
101+
return 0;
102+
}
103+
}
104+
return 1;
91105
#else
92106
base::uc16* substring1 = reinterpret_cast<base::uc16*>(byte_offset1);
93107
base::uc16* substring2 = reinterpret_cast<base::uc16*>(byte_offset2);
Collapse file

‎deps/v8/test/mjsunit/regress/regress-crbug-562108903.js‎

Copy file name to clipboard
+47Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright 2026 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+
// Canonicalize for /iu and /iv applies simple case folding to each code point
6+
// separately. Backreference comparison must not use full case folding, under
7+
// which e.g. U+00DF folds to "ss".
8+
//
9+
// Every case is spelled twice: once with literal characters, once with escapes.
10+
11+
// A leading non-Latin1 character forces the two-byte matcher.
12+
const prefix = 'Ā';
13+
14+
function assertBackrefMismatch(pattern, subject) {
15+
assertFalse(new RegExp(pattern, 'iu').test(subject));
16+
assertFalse(new RegExp(pattern, 'iv').test(subject));
17+
}
18+
19+
function assertBackrefMatch(pattern, subject) {
20+
assertTrue(new RegExp(pattern, 'iu').test(subject));
21+
assertTrue(new RegExp(pattern, 'iv').test(subject));
22+
}
23+
24+
// U+00DF SHARP S has a full folding to "ss" but no simple folding.
25+
assertBackrefMismatch(`^${prefix}(..)\\1$`, `${prefix}ßSsß`);
26+
assertBackrefMismatch(`^${prefix}(..)\\1$`, `${prefix}\u00DFSs\u00DF`);
27+
28+
// U+FB00 LIGATURE FF has a full folding to "ff" but no simple folding.
29+
assertBackrefMismatch(`^${prefix}(..)\\1$`, `${prefix}ffFfff`);
30+
assertBackrefMismatch(`^${prefix}(..)\\1$`, `${prefix}\uFB00Ff\uFB00`);
31+
32+
// Simple foldings still match.
33+
assertBackrefMatch(`^${prefix}(..)\\1$`, `${prefix}AbaB`);
34+
35+
assertBackrefMatch(`^${prefix}(.)\\1$`, `${prefix}ßß`);
36+
assertBackrefMatch(`^${prefix}(.)\\1$`, `${prefix}\u00DF\u00DF`);
37+
38+
// Folding across distinct code points needs the case mapping ICU provides.
39+
if (typeof Intl !== 'undefined') {
40+
// U+1E9E CAPITAL SHARP S folds to U+00DF.
41+
assertBackrefMatch(`^${prefix}(.)\\1$`, `${prefix}ẞß`);
42+
assertBackrefMatch(`^${prefix}(.)\\1$`, `${prefix}\u1E9E\u00DF`);
43+
44+
// U+212A KELVIN SIGN folds to "k".
45+
assertBackrefMatch(`^${prefix}(.)\\1$`, `${prefix}Kk`);
46+
assertBackrefMatch(`^${prefix}(.)\\1$`, `${prefix}\u212Ak`);
47+
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.