Commit Graph
1808 Commits
Author SHA1 Message Date
Chris Tate dd4ae4e508 Merge main 2026-10-24 01:57:53 -05:00
Chris Tate 7bf50dd9cc zlib: Brotli compression and decompression over the vendored brotli 1.2.0 (#2053) 2026-10-24 00:30:21 -05:00
Chris Tate de5557ce5a Answer Error.prototype for Object.getPrototypeOf of an Error (#2058) 2026-10-24 00:04:29 -05:00
Chris Tate fe3fd0de44 Parse URL hosts and paths as the URL Standard does, and inspect URLs as Node does (#2071) 2026-10-23 23:38:03 -05:00
Chris Tate cdef55778a Answer Error.prototype only while an error keeps its built prototype
Object.getPrototypeOf of an Error answers Error.prototype when the error's view was built from its fields and its prototype is still the object the view was built with. After Object.setPrototypeOf(error, {}), it answers the object that was set.
2026-10-23 23:31:30 -05:00
Chris Tate f060cad505 Inspect dynamic classes, functions and %o arguments as Node does (#1848) 2026-10-23 23:23:51 -05:00
Chris Tate f5972b0e75 Prepare v0.4.4 release (#2065) 2026-10-23 23:20:41 -05:00
Chris Tate 0b4deda1d0 Print URL {} past the inspect depth limit 2026-10-23 23:05:32 -05:00
Chris Tate f986d76d3b Bound Brotli parameter names in error messages 2026-10-23 22:57:22 -05:00
Chris Tate 3dcd730841 Detect class cycles by class identity when inspecting static fields 2026-10-23 22:50:14 -05:00
Chris Tate 52e84ad3b4 Parse URL hosts and paths as the URL Standard does, and inspect URLs as Node does 2026-10-23 21:57:53 -05:00
Chris Tate 9031ddafe0 Merge main 2026-10-23 21:50:24 -05:00
Chris Tate 9e07382bcd Merge main 2026-10-23 21:48:59 -05:00
Chris Tate e59fdca0f4 Search TypedArrays, read stdin through 'readable', and assign constructor-function globals (#1974) 2026-10-23 20:57:24 -05:00
Chris Tate f9e9f3cb52 Keep an error's name and message where a JavaScript factory created them (#2055) 2026-10-23 20:55:51 -05:00
Chris Tate 7784800c8e Prepare v0.4.4 release 2026-10-23 20:51:00 -05:00
Chris Tate a5db27a5a7 Merge main and fix the review comments 2026-10-23 20:24:35 -05:00
Chris Tate e813250813 Keep a constructor's name ahead of later properties in the runtime fallback 2026-10-23 20:22:14 -05:00
Chris Tate b2e609d73e Merge main 2026-10-23 20:20:34 -05:00
Chris Tate 1af3a86370 Compile unions of typed-array classes (#2011) 2026-10-23 20:00:12 -05:00
Malte UblandClaude Opus 5.5 1b5c90549a Answer Error.prototype for Object.getPrototypeOf of an Error
An Error's view had no prototype or a holder of its default name and
message, so Object.getPrototypeOf(new Error()) was Object.prototype or a
fresh object. A view of an error built as an Error, whose prototype is
still the one its view starts with, now answers Error.prototype.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:47:47 -07:00
Chris Tate a4e7a03761 Address review comments 2026-10-23 19:37:04 -05:00
Chris Tate 3a613c31a8 Merge main 2026-10-23 19:33:44 -05:00
Chris Tate e646764023 Merge main 2026-10-23 19:31:34 -05:00
Chris Tate d56a884011 Merge main 2026-10-23 19:28:30 -05:00
Chris Tate 9adb9692cd Accept file URL paths in existsSync and fs.promises (#2042) 2026-10-23 18:47:49 -05:00
Malte UblandClaude Opus 5.5 09f0342641 Keep an error's name and message where a JavaScript factory created them
zValidator's default failure hook serializes zod 4's ZodError with
`name` after `message` natively, and with the first `name` zod's factory
assigns ("$ZodError") when the second assignment took the typed slot.
ZodError instances are views of a JavaScript class extending Error: each
view rebuilds `message` and `name` from the error slots at fixed
positions (after `stack`, and after every other property), and the
property bag that holds the dynamically added properties copied its
committed, possibly stale, values over them.

A JavaScript Error subclass with a property bag now marks its class
(errorBagOrder), and its view calls scr_error_dyn_follow_bag after the
bag is copied: `name` and `message` move to follow the property they
followed when the bag was committed, and data values come from the
slots. TypeScript classes keep their views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:40:35 -07:00
Malte UblandClaude Opus 5.5 17721bae55 Answer builtin prototype reflection in untyped code as Node does
zod 4's z.record rejected every plain object natively ("expected record,
received object"): its isPlainObject reads o.constructor.prototype, which
was undefined, and asks whether that prototype has its own isPrototypeOf,
which Object.prototype answered false.

- The Object, Array and Error constructors held as values have their
  builtin prototype as a non-writable, non-enumerable, non-configurable
  own `prototype`; reading Function's constructor value's prototype
  throws SC2020 instead of answering undefined.
- hasOwnProperty / Object.hasOwn on Object.prototype answer its builtin
  members, and on Array.prototype its constructor;
  Object.getOwnPropertyNames lists them in Node's order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:40:07 -07:00
Chris Tate b7f86b9bb5 Run TypedArray methods on typed arrays held as untyped values (#2043) 2026-10-23 18:14:18 -05:00
Chris Tate a9da37b82e zlib: Brotli compression and decompression over the vendored brotli 1.2.0 2026-10-23 18:11:49 -05:00
Chris Tate 072543f5b9 Support X509Certificate fields and methods, TLS certificates and tls.Server contexts 2026-10-23 18:01:19 -05:00
Chris Tate 5a4935ed9e Settle Promise.all over different entry types on Node's turns (#1843) 2026-10-23 17:49:52 -05:00
Chris Tate 537710f61d buffer: fromArrayBuffer ranges, the deprecated constructor, Buffer as a value (#1970) 2026-10-23 17:46:42 -05:00
Chris Tate b09d5c6862 Merge main 2026-10-23 17:43:25 -05:00
Chris Tate 47d573d216 Pass undefined as this to strict callbacks and read Symbol.iterator once 2026-10-23 17:41:37 -05:00
Chris Tate da6419b2a8 Bound each epoll timer's deadline by clock reads around its arm call (#2045) 2026-10-23 17:36:22 -05:00
Chris Tate 68eda48251 Merge main 2026-10-23 17:27:47 -05:00
Chris Tate 7f8b0c2a09 Support X25519 keys and crypto.diffieHellman (#2039) 2026-10-23 17:23:19 -05:00
Chris Tate 0687bc4c0e Bound each epoll timer's deadline by clock reads around its arm call
The epoll timer heap test recorded a key's deadline from a clock read taken
before scrp_timer_arm, but the poller reads the clock again inside the call.
A loaded runner that paused the test between the two reads for more than a
millisecond made the poller's deadline later than the recorded one, and the
test's deadline-order check failed although the heap delivered every timer
in order.

The test now records the clock before and after each arm call and checks
order against those bounds, which hold however long the test is paused and
need no slack. A mutated heap that skips sifting down still fails the check.
2026-10-23 17:06:16 -05:00
Chris Tate 37b409897c Merge main 2026-10-23 17:01:10 -05:00
Chris Tate 7230b14f9d Represent Dates as objects with identity (#1915) 2026-10-23 16:49:26 -05:00
Chris Tate 6b3297e3a6 Run TypedArray methods on typed arrays held as untyped values 2026-10-23 16:33:09 -05:00
Chris Tateandjlucaso1 0b83599af4 Accept file URL paths in existsSync, fs.promises and order-checked fs calls
existsSync and the fs.promises functions accept a file: URL wherever
they accept a path. They convert it after their arguments are evaluated,
and a URL that does not convert gives false from existsSync and a promise
rejected with fileURLToPath's error from fs.promises, as in Node.

copyFileSync and renameSync check a string source for null bytes before
they convert a URL destination, and readFileSync checks a runtime
encoding before it converts a URL path, so the error Node reports first
is the one thrown.

Refs #1616

Co-authored-by: jlucaso1 <55464917+jlucaso1@users.noreply.github.com>
2026-10-23 16:27:40 -05:00
Chris Tate fc229822e7 Support X25519 keys and crypto.diffieHellman
X25519 KeyObjects come from generateKeyPair(Sync)("x25519"), which keeps
the private key clamped as OpenSSL does, and from createPrivateKey and
createPublicKey of PKCS#8, SubjectPublicKeyInfo, JWK (OKP, X25519) and
raw keys. They export in the same forms. sign, verify, createSign and
createVerify throw OpenSSL's "operation not supported for this keytype",
with its library, reason and code properties. X25519 uses mbedTLS's
Curve25519 group.

crypto.diffieHellman({ privateKey, publicKey }[, callback]) computes the
X25519 and ECDH secrets of two keys of one type, given as KeyObjects or
in any form createPrivateKey and createPublicKey read. The checks run in
Node's order: the options, the callback, both keys present, the key types
when both are KeyObjects ("Incompatible key types for Diffie-Hellman"),
then the public and private key inputs. Mismatched curves, a small-order
X25519 point and key types other than EC and X25519 throw OpenSSL's
errors. The callback form passes the secret, or the error without the
OpenSSL properties, in a later macrotask, as Node's DHBitsJob does.

createPublicKey also reads a private key's DER encodings (pkcs8 and
sec1), which Node accepts there.
2026-10-23 15:56:08 -05:00
Chris Tate 9eb14207a6 Revert "Cache untyped property access in programs that declare classes (reland)"
This reverts #2017 (adb8690f1), which made main CI fail.
2026-10-23 15:53:36 -05:00
Chris Tate 4acf7f047d Keep the key order of records spread from values JavaScript built (#2024) 2026-10-23 15:52:49 -05:00
Chris Tate e7943984a5 Bind both Dates before comparing, and cache only new Date locals as time values 2026-10-23 15:50:09 -05:00
Chris Tate 24a89488f9 Give glibc's per-thread heaps huge pages (#2032) 2026-10-23 15:41:30 -05:00
Chris Tate 9a2d378fba Run completion callbacks in their call's AsyncLocalStorage context (#1804) 2026-10-23 15:29:35 -05:00
Chris Tate 59e5c0cf8a Merge main and keep declared keys in ordered spreads 2026-10-23 15:20:26 -05:00