Original commit message:
[regexp] Handle supplementary case equivalents of BMP characters
Unicode 18 adds U+1DF95, which simple-folds to U+00DF. This creates the
first case-equivalence class spanning BMP and supplementary characters:
{U+00DF, U+1E9E, U+1DF95}.
Discard supplementary characters from the generator's non-unicode
closures before calling Canonicalize, which requires UTF-16 code units
and otherwise CHECK-fails with ICU 79. Apply the same filtering in
runtime non-unicode closure.
Generate SupplementaryEquivalentsSet and desugar its BMP characters into
character classes under /iu and /iv, allowing literals to match
surrogate pairs.
Backreferences with differing UTF-16 character widths remain unsupported
and are tracked in crbug.com/571793821.
IgnoreSet is unchanged with ICU 78 and with ICU 78.2 patched to upstream
Unicode 18 case data. With the patched data, the generator succeeds,
SupplementaryEquivalentsSet is {U+00DF, U+1E9E}, and regexp tests pass
in release and debug.
Bug: 571232615, 571668686
Change-Id: I9eacb273a74c66e17f0cfb1b256e863f2718c130
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8548134
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110522}
Refs: https://github.com/v8/v8/commit/f607706154eabc4a949628a88b38dbe95cd2274c
Co-authored-by: Renegade334 <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67527
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Original commit message:
[regexp] Do not combine lone surrogates in TextBuilder
In Unicode mode (/u and /v), valid surrogate pairs are already combined
into single uc32 code points (> 0xFFFF) by the scanner (ReadNext),
escape parser (ParseUnicodeEscape), or ICU string iterator (U16_NEXT)
before TextBuilder is called.
Remove the obsolete pending_surrogate_ state and
AddEscapedUnicodeCharacter workaround from TextBuilder/Builder so that
separate lone lead and trail surrogates (such as in \q{} class strings)
are never falsely combined into a surrogate pair.
Fixed: 569770971
Change-Id: Ic4c45bbd565171dc24c49c60d1c6d25ce6f4c256
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8529770
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110442}
Refs: https://github.com/v8/v8/commit/35423c16d252663c4b8fad252a6f2aded5d51482
Co-authored-by: Renegade334 <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67527
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Original commit message:
[regexp] Make generated IgnoreSet independent of the build locale
gen-regexp-special-case implements Canonicalize (ECMA-262 22.2.2.9.3)
for non-unicode /i, which is defined in terms of the locale-independent
String.prototype.toUpperCase. It called icu::UnicodeString::toUpper()
without a locale, which uses the ICU default locale of the build host.
Under tr and az, 'i' uppercases to U+0130, so 'i' and 'I' were added to
IgnoreSet and /i/i no longer matched "I".
Uppercase in the root locale. The generated tables are unchanged for
non-tr/az build hosts.
Change-Id: I49c62a41e8e47abc2e6c84ac091a4533f917ed97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8459863
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110086}
Refs: https://github.com/v8/v8/commit/bb0e798c09e30594496fbca013a7d6ebd5e15e4c
PR-URL: https://github.com/nodejs/node/pull/67527
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Original commit message:
[regexp] Share matcher case equivalence when factoring alternatives
Alternative sorting and prefix factoring used full case folding, which
can merge characters that the matcher treats as distinct in legacy /i
mode, such as U+017F and s.
Use shared CaseFolding::EquivalenceKey and CloseOver operations for
comparisons and character expansion. Preserve UTF-16 code-unit handling
in non-unicode mode and code-point decoding in Unicode backreferences.
Remove the generated SpecialAddSet while retaining exact Canonicalize
for IgnoreSet generation.
Add exhaustive release-only BMP equivalence and closure checks, plus
coverage for alternatives, literals, ranges, and backreferences. Restore
the real assertEquals in regress-10573.
Change-Id: Idbf3866ca99c5446aeab15fd21f841d2f77d4243
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8456723
Commit-Queue: Patrick Thier <pthier@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110082}
Refs: https://github.com/v8/v8/commit/ee1c92f63568592d2362127ff9981e2fc75e9e6d
Co-authored-by: Renegade334 <rene@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/67527
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Original commit message:
[regexp] Use simple case folding for /iu backreferences
Backreference comparison in unicode mode went through
icu::UnicodeString::caseCompare, which applies full case folding to the
whole string. Canonicalize (ECMA-262 22.2.2.9.2) instead applies the
simple case folding of each code point separately, so e.g. U+00DF must
not fold to "ss". As a result /^(..)\1$/iu matched "ßSsß", since both
halves full-fold to "sss".
The rest of the engine already closes character ranges over
USET_SIMPLE_CASE_INSENSITIVE, so only backreferences were affected, and
only for two-byte subjects: the one-byte matcher compares code units
inline.
Replace caseCompare with a per-code-point loop over u_foldCase. This
also drops the icu::UnicodeString construction from the matcher's hot
path.
Fixed: 562108903
Change-Id: I277040a7d8c310bf7833f8fbcce2f005f823047c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8423859
Commit-Queue: Patrick Thier <pthier@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109970}
Refs: https://github.com/v8/v8/commit/53588faba3ed165c7e713d077d6b90fadf795887
PR-URL: https://github.com/nodejs/node/pull/67527
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Since chunked writes are coalesced while the message is corked,
write() decides backpressure from the byte length of the buffered
chunks and sets kNeedDrain. When uncork() flushes them, net.Socket
accounts string chunks in UTF-16 code units, so with multi-byte text it
can stay below its own highWaterMark. It then never needs to drain and
never emits 'drain'. If the flushed writes complete asynchronously, the
check at the end of uncork() also runs while bytes are still pending,
so the response stalls with writableNeedDrain === true and
writableLength === 0.
Re-check the drain condition once the flushed data has been written,
unless the message or its socket has been destroyed in the meantime.
Fixes: https://github.com/nodejs/node/issues/66781
Refs: https://github.com/nodejs/node/pull/64987
Assisted-by: AI coding agent
Signed-off-by: junyup0503 <97156898+junyup0503@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/66782
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
The binary tarball target only codesigns bin/node. Notarization runs
only for the pkg, and tools/osx-notarize.sh only knows how to submit a
pkg, so every darwin tarball binary ships signed but without a ticket.
Gatekeeper then applies a full trust evaluation to each process spawned
through it, which slows down every CLI shim on macOS.
Make tools/osx-notarize.sh take a path instead of a version id. A .pkg
keeps the existing flow. Any other file is treated as a Mach-O binary:
it is zipped with ditto, submitted with notarytool, and the ticket is
verified with `codesign --verify -R=notarized` using the existing retry
helper. spctl cannot be used for that check, it rejects command line
tools as "not an app". The binary itself is not modified, so published
checksums do not change. A bare version id is still accepted and
resolved to node-<version>.pkg for the release branches.
Call the script from the binary target after codesign. It is a no-op
unless the NOTARIZATION_* variables are exported, so the tarball jobs
keep behaving as today until the release job injects them.
Refs: https://github.com/nodejs/node/issues/67140
Refs: https://github.com/nodejs/build/issues/3538
Refs: https://github.com/nodejs/build/issues/4545
Refs: https://github.com/nodejs/node/pull/66855
Assisted-by: Claude
Assisted-by: Codex
Signed-off-by: Ulises Gascon <ulisesgascongonzalez@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67143
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
The pbkdf2() call that keeps the only threadpool worker busy used a
6-byte password and a 4-byte salt. OpenSSL 4 FIPS rejects those, so
the derivation failed at once and freed the worker. The queued stat
could then start before req.cancel() ran, and it completed without
ECANCELED.
Use inputs that meet the FIPS minimums and check that the derivation
succeeds.
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67449
Refs: https://github.com/nodejs/node/pull/67248
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
A JavaScript number is always bound with sqlite3_bind_double(), so it is
written as REAL even when it has no fractional part. A BigInt is bound
with sqlite3_bind_int64() and is the way to write an INTEGER. The type
conversion table listed number under both INTEGER and REAL without
saying which applies when, so the rule had to be discovered by
experiment.
Column type affinity hides this most of the time, which is why the cases
it does not cover are surprising. Comparing against a TEXT column is the
worst of them: the number 3 compares as '3.0' and silently fails to
match a stored '3', with no error to point at the cause. Document the
rule, the reason for it, and that case, and remove number from the
table's INTEGER row. Point the virtual table section's link at the new
text.
better-sqlite3 binds numbers the same way and has fielded the same
question repeatedly (WiseLibs/better-sqlite3#165, #627, #897, #1144,
#1313), each time closed as working as intended.
Fixes: https://github.com/nodejs/node/issues/63826
Refs: https://github.com/WiseLibs/better-sqlite3/issues/627
Assisted-by: Claude Opus 5.5
Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67424
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
Add --test-forbid-only and the forbidOnly run() option to detect
accidentally committed exclusive tests. Reject only declarations and
runOnly(true) in both isolation modes, and record a run-level failure
so TODO and expected failures cannot absorb the error.
Document the runtime-only detection and add regression coverage for
filtering, option inheritance, both isolation modes, and disabled
guards.
Refs: https://github.com/nodejs/node/issues/60917
Assisted-by: a coding agent
Signed-off-by: João Victor <joao.oliveira@softtor.com.br>
PR-URL: https://github.com/nodejs/node/pull/66578
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>