0.4.7
Highlights
- Node.js parity:
Intl.Segmentersplits text into graphemes and words, andtoLocaleStringuses the default locale, on Linux x64 (ICU 78.3). Malformed UTF-8 in directory entries and command-line arguments decodes to U+FFFD, as in Node.- node:http emits Node's abort events, matches Node's outgoing header behavior, and checks
http.requestoptions before a socket opens. Sockets aftersetEncodingpipe decoded strings, untyped listen ports are validated, and net errors carry Node's system properties. - node:querystring and node:string_decoder match Node 24 for values known only at run time, and node:path matches Node 24's path tests.
TextDecodermatches Node's errors, options and printing. structuredClonecopies Maps and Sets.SharedArrayBuffer,DataView,BigInt64Array,BigUint64Array,ProxyandIntlcan be read as values.process.memoryUsage()counts ArrayBuffer storage.import()of a specifier that cannot be resolved rejects withERR_MODULE_NOT_FOUND. fs reads return Buffers in programs that can observe the difference. Values held fromprocess.envread the live environment.- EventEmitter and stream listeners are called with the emitter as
this, listeners that readargumentsreceive every argument, and the leak warning is delivered at exit.'error'events accept non-Error payloads. - readline accepts listener values and ends lines at U+2028 and U+2029.
fs.watchnames the changed entry.assert.throwsreports validation-object failures as Node does. - Executables ignore SIGPIPE and SIGXFSZ, as Node does. Timer deadlines hold on macOS, and intervals re-arm as in Node. Timeout delay warnings are emitted, and untyped timer delays convert with ToNumber.
process.emitWarning,process.kill,process.chdirandos.userInfobehave as in Node. Replacingprocess.stdout.writeorprocess.stderr.writereceives the arguments, Buffers and whole writes that Node passes.- JavaScript semantics from Test262: each evaluation of a class expression creates its own class, private static members check their brand, wrapper objects for strings, numbers and booleans work in JavaScript sources, and Set, Map and weak-collection methods can be read as values.
for...inruns over a value that may be null or undefined. A null or undefined destructuring source throws Node's TypeError. Functions held in records and arrays keep their names.
- Node islands:
- Sloppy-mode modules and modules that patch builtins run in Node islands automatically.
- Islands can
requireCommonJS modules and hold builtin classes, and garbage cycles are collected across the program's heap and Node's. - Island modules whose load is deterministic are deferred until first use, and shared modules resolve by real path, so caches reached through symbolic links work.
- Faster programs:
- Untyped code calls methods of compiled class instances inline.
- Integer arithmetic: sums built on unsigned shifts stay in 32 bits, and loops are versioned on the range of locals they write as remainders. Saturating loops that run together test their exit every fourth iteration.
- Number-key map lookups test the direct index once and inline the probe in loops.
- Streams: taking from a Readable's buffered queue is constant time, object-mode stream callbacks do less work per chunk and keep typed records unboxed, and a line goes to a single line listener directly.
- fs streams read and write cached regular files on the loop thread, worker threads that allocate large blocks no longer reread the process's memory map, and constructors store their own fields without releasing a previous value.
--cpu-dispatchkeeps x86-64-v3 code from running slower than the baseline.- Profile-guided builds compile the functions a profile never ran as cold code, and weigh profile matches by the profile's counts. The runtime profile is refreshed.
- x86_64 musl executables use SSE2 memory routines and the runtime's rounding and libm definitions.
- Faster builds:
- The native compiler's optimization profile is refreshed: its code is 63.0 MB instead of 73.9 MB, so builds use less memory and run faster.
- Optimized partitions of builds without a profile run a lighter simplification before they are linked, and builds that use a profile keep the full one. Partition placement stays stable when an edit adds a small helper, so more partitions stay cached.
- A compile reads and stats each file once and reuses its type checker across module loads, and finished checker processes no longer stay as zombies.
- The type checker executable is written once, and builds with an empty cache no longer hash the runtime pack's artifacts again.
- Large modules decide in one pass whether fs reads must return Buffers.
- Memory and size:
- Programs return freed memory sooner: large strings are freed when they are released, writes of large shared views go out in chunks, and the main thread returns free pages when its event loop waits.
- An HTTP response whose socket closes releases its completion callbacks, and the web view of an abandoned fetch body is released while its transfer runs.
- Intl executables ship ICU data without the categories no Intl form reads (21.5 MB smaller), and the runtime pack is 24 MB smaller on Linux x64.
- TypeScript: an
import sourceclause from TypeScript 7.1 is reported as unsupported instead of failing the build, and more record, union and generic patterns compile: spreads of unions with an absent arm, literal-union keys of one field type, partial record assertions, records cast fromunknown[]elements, andentries().filterin generic bodies.