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.
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.
- 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.
`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>
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.
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).
- 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.
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.
- 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.
The checker types Promise.prototype as Promise<any>, so an inferred binding
of it, a module const or a local, inserted a promise check against the
ordinary object and threw a TypeError at initialization. Such bindings,
including promise.constructor.prototype, now stay checked-dynamic in
TypeScript as they already did in JavaScript, and corpus 6590 covers them.
A const initialized by an array literal and spread once can still run
that spread more than once: in a loop body, loop test or update, a
function, or a class field initializer. Each run inserts the same
elements in JavaScript, so copying them into the destination's layout
would break identity. Those spreads keep the element-layout refusal.
Each armed site lowers the code after it twice, and a cast inside another
site's tail is lowered in both copies, so n sequential casts produced 2^n
copies of the code after the last one. A site now arms only while fewer
than two splits enclose its tail or share its split point; later casts
keep the throwing cast.
The stream probes for untyped values (pipe destinations, pipeline
stages, readline input and output, and the checks against the stream
classes) read the vtable word of any boxed object. Instances with a
class id in the rc word have no vtable word, so a hierarchy instance
whose first field is a number crashed those probes. scr_stream_vt_of
answers NULL for them, and each probe treats that as no stream.
workloads.json listed every workload in one array, and its README table
listed them in one hand order, so changes that each added a workload
appended at the same place and conflicted. Each workload is now a JSON
file in benchmarks/runtime/workloads/ named after it, read through
benchmarks/runtime/workloads.mjs by the bench runner, the zero-cost
gate, the strace script and the dynamic-tier test, ordered by category
and then name. The loader still reads workloads.json in a checkout from
before this change, so the gate can compare against one. The README
table follows the same order.
The lib-fn sets and prefix lists in runtime-features.ts grew by
appending, so changes that added different entries to one list touched
the same last lines and conflicted. Each list's entries are now sorted
within its commented groups, and the all-off feature literal follows the
rules table's name order. Entry order is unobservable: the lists feed
membership maps and prefix tests that each set their own flag.