$ the-wire · showcase
Buffer.stringLength(), and a trace_events abort for embedders
By RepoJournal · Filed · About Node.js · Composed from the cited sources · methodology
Node gained a streaming-friendly counterpart to Buffer.byteLength, while an embedder-only trace_events crash and an undici HTTP/2 exit-before-settle bug got fixes.
buffer: add Buffer.stringLength() nodejs/node
Buffer.stringLength(input[, encoding]) returns the UTF-16 code unit count buf.toString(encoding) would produce, without decoding: simdutf handles UTF-8 and invalid input is counted with the same maximal-subpart replacement the decoder applies, so the number always matches toString().length. Code accumulating streamed input can now check the resulting string size before allocating it.
trace_events: fix abort when Node.js does not own the V8 platform nodejs/node
Requiring node:trace_events and calling createTracing() aborted the process, and getEnabledCategories() dereferenced a null pointer, when Node runs on an embedder's own V8 platform (kNoInitializeNodeV8Platform): lib/trace_events.js checked only the compile-time hasTracing flag and ownsProcessState before handing a nonexistent tracing::Agent to the binding. The binding now reports whether an age...
fix(h2): keep the session ref'd while requests are queued nodejs/undici
resumeH2() unrefs the HTTP/2 session when the peer advertises SETTINGS_MAX_CONCURRENT_STREAMS = 0 even with requests still queued, leaving nothing to keep the event loop alive, so the process exits with status 0 while the awaited request never settles. The client[kMaxConcurrentStreams] === 0 clause is removed from the condition in lib/dispatcher/client-h2.js; this is the v7.x fix ported back.
test: move permission FFI test to native suite nodejs/node
The permission drop test moves to the FFI suite so test-ci-js no longer needs the native FFI fixture library, and the Windows native suites now include ffi to match the Makefile, building its fixture for test-ci-native but not test-ci-js. This addresses the test failing when the native FFI fixture is absent.
test: deflake user timing WPT assertions nodejs/node
The fixed 20 ms tolerance in mark.any.js could fail when execution paused between creating a mark and reading the clock; the test now checks the mark timestamp against readings taken before and after mark(), keeps the vendored fixture and subtest names unchanged, and applies script modifiers to worker entry scripts. Two more CI flakes went quiet elsewhere: the decompress test now waits for high...