Commit Graph
3548 Commits
Author SHA1 Message Date
Chris Tate bde7afa980 Compile undici from a built-in implementation (#1425) 2026-10-20 21:14:37 -05:00
Chris Tate 3abf43affd Use the events module and EventEmitter as untyped constructor values (#1544) 2026-10-20 21:12:06 -05:00
Chris Tate eb8a148605 Merge main 2026-10-20 21:01:40 -05:00
Chris Tate 115a763df8 Check that the limitations partials keep one sentence per line (#1571) 2026-10-20 20:59:02 -05:00
Chris Tate adf4912d83 Run the partials check before oxlint in pnpm lint
pnpm appends forwarded arguments to the end of a script, so with the
partials check last, `pnpm lint:fix` and `pnpm lint --format=json` passed
their flags to the check instead of oxlint. The check now runs first; it
prints nothing when the partials are split, so oxlint's output, JSON
included, is unchanged.
2026-10-20 20:56:56 -05:00
Chris Tate 53171c282d Read and write dynamic-tier properties through shapes and inline caches (#1396) 2026-10-20 20:52:12 -05:00
Chris Tate 9a802fe635 Leave the per-chapter status counts out of the compatibility files (#1608) 2026-10-20 20:48:27 -05:00
Chris Tate 06e202a126 Leave the per-chapter status counts out of the compatibility files
The ledger and the public artifact held a block of status counts for
every chapter. Nothing reads them (the docs page uses a chapter's slug
and title), and every classification change rewrote its chapter's block,
so concurrent compatibility changes conflicted there. The rows they were
counted from are unchanged.
2026-10-20 20:46:25 -05:00
Chris Tate 5e2e65a805 Build the Node compatibility backlog from the ledger instead of committing it (#1576) 2026-10-20 20:44:36 -05:00
Chris Tate 70e0af8094 Keep shapes off objects that threads share
A published graph is immortal and shared by pointer across threads, but a
shape names a node of one thread's transition tree, which ends with that
thread. A worker that read a published object through a cache left its
shape in the object; after the worker exited, the main thread's reads
followed it into freed memory. Immortal objects now stay unshaped, and
publishing (postMessage's shared graphs and @scriptc/threads publish)
clears a shape the object already has.
2026-10-20 20:44:14 -05:00
Chris Tate 3ef1b9f7be Merge main 2026-10-20 20:40:58 -05:00
Chris Tate 94aa7065f1 Compile the remaining corpus programs with the native compiler (#1418) 2026-10-20 20:29:41 -05:00
Chris Tate 6e278b8487 Name the spread expression in not-iterable errors for values held as any (#1587) 2026-10-20 20:25:52 -05:00
Chris Tate af502aab45 Revert "Check the optional-record path test's cast at the cast" (#1605) 2026-10-20 20:24:56 -05:00
Chris Tate 97d6ebac6a Revert "Check the optional-record path test's cast at the cast (#1592)" 2026-10-20 20:22:18 -05:00
Chris Tate 5a1882957d Convert Promise and record results and record arguments in function adapters (#1556) 2026-10-20 20:21:38 -05:00
Chris Tate 81bc045524 Spin briefly before a mailbox wait blocks, and signal after the unlock (#1400) 2026-10-20 20:20:14 -05:00
Chris Tate 08c7930958 Support crypto.createECDH and ECDH.convertKey (#1589) 2026-10-20 20:18:22 -05:00
Chris Tate 7ccd9fb3ac Name functions stored in JavaScript object literals as Node (#1591) 2026-10-20 20:17:19 -05:00
Chris Tate f32c309baa Declare function adapter scratch locals in the adapter
A function value whose result is a union of records, assigned to a slot
that returns one record type, lifts each record arm into the slot's
record. The lift declares a scratch local, which went into the function
that requested the adapter, so calling the adapted function failed IR
validation. The adapter body now lowers in its own function context and
the adapter declares those locals.
2026-10-20 20:16:46 -05:00
Chris Tate fae56ff409 Run exec on regular expressions held as any (#1600) 2026-10-20 20:16:04 -05:00
Chris Tate 9eae4af46c Drop the undici shim type test from the TypeScript 5 import allowlist
The test checks the shims with the TypeScript 7 checker and no longer
imports typescript5, so test-ts7 reported its allowlist entry as stale.
2026-10-20 20:08:11 -05:00
Chris Tate a5294f1ec5 Read runtime keys of package enum objects as checked-dynamic values (#1603) 2026-10-20 20:07:13 -05:00
Chris Tate b04166a8f0 Read runtime keys of package enum objects as checked-dynamic values
The enum rewrite turns a package's numeric enum into one object holding
its names and its reverse mapping, so the object's fields have different
types. A reverse read with a runtime key, such as
DiagLogLevel[DiagLogLevel.WARN] in @opentelemetry/api, then failed with
SC1090 ("the declared fields have no one common type").

A keyed read of such a record already answers a checked-dynamic value in
JavaScript files. It now does the same where the checker types the read
'any'. The new npm case tsc-enum-reverse-reads matches Node, as does the
opentelemetry-api case again.
2026-10-20 20:04:06 -05:00
Chris Tate 904b773d0a Adopt thenables in await of untyped values, and read Promise.prototype as a value (#1562) 2026-10-20 19:58:53 -05:00
Chris Tate 4e80351f87 Merge main 2026-10-20 19:53:23 -05:00
Chris Tate aec7758dfb Revert the checked-cast fallback (#1561); keep the optional-chain fix (#1601) 2026-10-20 19:46:23 -05:00
Chris Tate 97e9a10a13 Destructure runtime computed keys from records and checked-dynamic values (#1552) 2026-10-20 19:40:42 -05:00
Chris Tate ca379c5d14 Run exec on regular expressions held as any
exec on a regular expression held as an untyped value threw "Native RegExp
method has no lowering". It now returns Node's match array: the captures,
with undefined for one that did not participate, then index, input and
groups, or null without a match. Global and sticky expressions read and
advance lastIndex and reset it when nothing matches, as the typed exec
does.
2026-10-20 19:38:31 -05:00
Chris Tate dffefb4120 Keep missing runtime-key entries undefined in parameter patterns
- The indexed-read prepass now scans parameter patterns with the parameter's type. A function that destructures a missing runtime-key entry of an index-signature record from a parameter (`function pick(k, { [k]: v }: Record<string, number>) { return v; }`) returns undefined instead of throwing a TypeError, nested patterns included.
- Corpus 6492 adds a function, an arrow and a nested parameter pattern; 6492 and 6493 get their per-program cost files.
2026-10-20 19:37:06 -05:00
Malte UblandClaude Opus 5.5 22b9db26b5 Short-circuit optional chains on any values only on the guarded step
`a?.b.c` on an `any` value answered undefined when `a` was present and
`a.b` undefined: every later step of the chain read optionally. Node
short-circuits only on the guarded receiver and throws reading `.c`.

An `any` receiver now makes the tail an optional chain like a dyn one,
and inside the chain's guarded body the consumed `?.` no longer marks
the later dynamic reads optional. (Kept from #1561, whose checked-cast
fallback is reverted.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:36:52 -07:00
Chris Tate 121a3ed8f6 Check the optional-record path test's cast at the cast (#1592) 2026-10-20 19:29:13 -05:00
Chris Tate 1f4f7d822f Merge main 2026-10-20 19:27:58 -05:00
Chris Tate 2230ffbb27 Check the optional-record path test's cast at the cast
The test from #1548 casts JSON.parse to Partial<Envelope> into a
block-local const, which continues as its parsed value since #1561, as
in Node. The path messages are now pinned with the cast passed to a
typed parameter, which is checked at the cast, and the block-local form
is pinned against Node.
2026-10-20 19:25:18 -05:00
Chris Tate c812518fb3 Merge main 2026-10-20 19:24:28 -05:00
Chris Tate 35c48c93a6 Name functions stored in JavaScript object literals as Node does
A function stored in a JavaScript object literal's property printed as
[Function (anonymous)] and had an empty `.name`. The property's boxed
function now takes the name Node gives it: a function read by name keeps
that name (`{ f }`, `{ k: f }`), and an anonymous function, arrow or method
takes the property's key (`{ g: function () {} }`, `{ m() {} }`,
`{ 'a-b': () => 1 }`, a computed key that folds to one string).
2026-10-20 19:23:31 -05:00
Chris Tate eac75404d5 Merge main 2026-10-20 19:19:07 -05:00
Chris Tate 2582e46e76 Support crypto.createECDH and ECDH.convertKey
crypto.createECDH returns a native ECDH handle backed by mbedTLS for
prime192v1, secp224r1, prime256v1, secp384r1, secp521r1, secp192k1,
secp224k1, secp256k1, brainpoolP256r1, brainpoolP384r1 and
brainpoolP512r1. generateKeys, computeSecret, getPublicKey,
getPrivateKey, setPrivateKey, setPublicKey and ECDH.convertKey follow
Node 24: compressed, uncompressed and hybrid points, input and output
encodings, the private key range, key pair validation, and Node's error
codes and messages.

Curve names follow OpenSSL's short-name lookup: names of other curves
from crypto.getCurves() are refused at compile time when literal and
throw a coded SC2020 error when computed, other OpenSSL short names
throw ERR_CRYPTO_OPERATION_FAILED, and unknown names throw
ERR_CRYPTO_INVALID_CURVE. Calls whose arguments no @types/node overload
accepts, and computeSecret(view, encoding), are refused at compile time.

The runtime unit scr_ecdh.c links, with the mbedTLS archive, only into
programs that use ECDH. wasm32-wasi builds refuse it.
2026-10-20 19:17:05 -05:00
Chris Tate f63e99a7de Name the spread expression in not-iterable errors for values held as any
Spreading a value held as any that is not iterable into an array literal
threw `TypeError: value`. It now throws V8's message, which names the
spread expression: `x is not iterable` for an identifier or property path,
through parentheses and type assertions, and `f is not a function or its
return value is not iterable` for a call of one. for...of and array spread
share the helper that spells it.
2026-10-20 19:10:56 -05:00
Chris Tate 222ea51bd8 Keep missing runtime-key entries undefined in nested module-scope patterns
- The indexed-read prepass now visits nested object patterns with the nested element's own type. A module-scope binding from a missing runtime-key entry of a nested index-signature record (`const { limits: { [key]: limit } } = config`) holds undefined instead of throwing a TypeError, with or without a default for the nested source.
- Corpus 6492 adds both nested forms.
2026-10-20 19:09:12 -05:00
Chris Tate 50f93d0be0 Merge main 2026-10-20 19:05:22 -05:00
Chris Tate f7e8d7c490 Compile import cycles whose class is reached only after initialization (#1495) 2026-10-20 18:55:01 -05:00
Chris Tate e41f642a55 Compile literal-key 'in' over index-signature records, fresh array spread insertions, and any-annotated dictionaries (#1514) 2026-10-20 18:46:29 -05:00
Chris Tate 145268ed55 Inspect program-declared Error subclasses with Node's constructor-name header (#1520) 2026-10-20 18:43:16 -05:00
Malte Ubl c76892dc74 Revert "Continue a failed checked cast with its value in a dynamic tail (#1561)"
This reverts commit 6bb2711c4b, reversing
changes made to cd833e68a4.
2026-10-20 16:42:01 -07:00
Chris Tate 71325b2a00 Keep exported const arrays out of fresh spread conversion
Another module can import an exported const (`export const` or an
`export { name }` specifier) and reach its elements, so a spread of it
is not their only reference. Those spreads keep the element-layout
refusal instead of copying the elements.
2026-10-20 18:40:37 -05:00
Chris Tate 3df33dc0ab Keep the process.versions scan flag on the lowerer (#1579) 2026-10-20 18:38:46 -05:00
Chris Tate 32630717ed Return the Set from add() when its result is used (#1523) 2026-10-20 18:36:59 -05:00
Chris Tate c5eb832ef1 Keep the process.versions scan flag on the lowerer 2026-10-20 18:36:38 -05:00
Chris Tate 9baa93b799 Keep missing runtime-key entries undefined at module scope, and check nullish sources before runtime keys
- The indexed-read prepass now treats a computed pattern key like the name it folds to, and a runtime key over a record with no declared fields as an index-signature read. A module-scope binding from a missing entry (`const { [name]: v } = table` over `Record<string, number>`) now holds undefined instead of throwing a TypeError.
- An object pattern over a checked-dynamic value whose first key is computed at run time checks the source first. A null or undefined source throws a TypeError before the key's expression runs, as in Node. In JavaScript declarations whose source V8 can spell, the message is Node's ("Cannot destructure 'f(...)' as it is null.").
- Corpus 6492 adds a module-scope missing entry; 6493 adds nullish sources in front of side-effecting keys, including a nested pattern and an element default.
- The retired-engine-2104 diagnostics snapshot drops the refusals of `const { [key]: got } = src` over an `any` source, which now compile. The remaining refusals are unchanged.
2026-10-20 18:34:42 -05:00