Commit Graph
11967 Commits
Author SHA1 Message Date
Chris Tate f51900a76b Publish HTTP server diagnostics channels (#4647)
* Publish HTTP server diagnostics channels

* http: keep the response's socket through the finish-channel publish
2026-11-30 04:54:23 +00:00
Chris Tate 2303a95c3f Resolve esbuild getter-table exports like plain exports (#4583)
* Resolve esbuild getter-table exports like plain exports

- cjs: resolve esbuild getter-table exports like plain exports.

* lowering: leave the getter-table memo out of the unit journal

* program-facts: register the getter-table shape prefilter

The getter-table recognizer tests a module's source text for the `__export`
helper before walking its statements. Every whole-program text test is
registered so the registry says what the scan decides; this one is a
prefilter, and the walk behind it decides the shape from the module's
syntax tree.

* cjs: snapshot a getter-table export at every destructuring declaration
2026-11-30 03:55:06 +00:00
Chris Tate c356557dd9 Accept Node's MessagePort and BroadcastChannel argument forms (#4653) 2026-11-30 03:54:36 +00:00
Chris Tate 8872466342 Emit a signal only to listeners of that name (#4649) 2026-11-30 03:14:58 +00:00
Chris Tate 4b32f98eb9 Record stripTypeScriptTypes strip mode in the compatibility ledger (#4651) 2026-11-30 03:14:28 +00:00
Chris Tate efe5c8620c Hold an absent JSON result in its binding (#4486)
* Hold an absent JSON result in its binding

- Hold an absent JSON result in its binding.

* compiler: register the JSON.stringify binding scan
2026-11-30 02:37:47 +00:00
Chris Tate 809a65fa4a Read late-filled CommonJS exports from the exporter's storage (#4645) 2026-11-30 02:36:11 +00:00
Chris Tate 2c5566089c Match Node for HTTP/2 compat request and response members (#4640)
* Answer an HTTP/2 compat request's complete once it is aborted

The dynamic read of `complete` on the compatibility request answered only
the HTTP/1 flag, so a request whose stream the peer reset reported false
while Node reports true once the message can receive no more body.

* Answer "" for an HTTP/2 compat response's statusMessage

The dynamic read fell through to the HTTP/1 reason phrase, which an h2
response never has, so it answered undefined where Node answers "". The
request it serves over an h2 stream now answers the empty reason phrase.

* Answer an HTTP/2 compat request's stream member

A dynamic read of `stream` on the compatibility request fell through to
undefined; Node exposes the Http2Stream it is carried on. The member now
answers that stream.

* Hold the http2 iterator across the error and close drains
2026-11-30 02:16:11 +00:00
Chris Tate b3a6a4a532 Pass the fork IPC handles to a forked child on Windows (#4646) 2026-11-30 02:15:09 +00:00
Chris Tate f3e3751997 Match Node's Connection header token parsing (#4643) 2026-11-30 01:55:05 +00:00
Chris Tate dad48aa596 Dispatch signal listeners from process.emit (#4457)
* Dispatch signal listeners from process.emit

- process: emit a signal's listeners synchronously.

* process: emit signal listeners with no arguments, on the main thread

* process: island signal listeners get no emit arguments either

* process: three review fixes for emit

* process: a once listener removed mid-dispatch still runs

* process: the exit cleanup releases a once signal listener's wrapper state
2026-11-29 20:36:39 +00:00
Chris Tate 3a64c37062 Verify Windows island cache ownership and DACLs before reuse (#4625)
* Verify Windows island cache ownership and DACLs before reuse

* Create island directories owned by the user, not the token's default owner

- An elevated administrator token's default owner is BUILTIN\Administrators,
  so a directory the runtime created was owned by another principal and failed
  the ownership check on the next start: island modules never loaded.
- The protected descriptor now names the token's user as the owner, so a tree
  this process created passes the check under an elevated or a normal token.

* Never delete an island tree another process may be loading from

- When the digest directory cannot be moved aside, the run installed into a
  shared `.local` tree and deleted the previous one on every start, even
  while another process was loading from it.
- The fallback now installs into a fresh random-named sibling and deletes
  nothing, so two concurrent launches each load a whole tree of their own.
2026-11-29 20:36:09 +00:00
Chris Tate d377164bc5 Give spawned children only their stdio handles on Windows (#4641)
* Give a spawned child only its stdio handles on Windows

- The child launcher starts the child with an explicit handle list holding the
  child's own inheritable duplicates of its stdio descriptors, so no other
  handle this process holds is inherited.
- The STARTUPINFO names only what that list holds.

* Fail a Windows spawn that cannot restrict what the child inherits

- When the handle list cannot be built or updated, or one of the child's
  stdio duplicates cannot be made, the spawn now fails with that error
  instead of handing the child every inheritable handle the process holds.
- Only the listed duplicates reach the STARTUPINFO, and a spawn with no
  stdio slots passes bInheritHandles = FALSE instead of falling back.
2026-11-29 20:35:02 +00:00
Chris Tateandyukkes da06452b85 Find a static write's classes without rescanning the program (#4618)
* Find a static write's classes without rescanning the program

Closes #4559
Co-authored-by: yukkes <44968006+yukkes@users.noreply.github.com>

* Prune visited classes in the static-write descendant walk

The reverse map lists a class under every superclass name isSubclassOf
recognizes (its bases along the base chain and each generic family), so two
names can lead to the same class. The walk tested `!seen.add(name)`, but
Set.prototype.add returns the set, so the test never pruned anything: a chain
whose links carry two names follows every path instead of visiting each class
once, which is exponential in its depth and exhausts CPU and heap.

The walk now checks has() before add(), and lives in descendantClasses
(class-descendants.ts) with unit tests for the doubled chain (bounded at
2^30 visits without the prune), a reconverging diamond, and the start class.
A 30-class chain whose base constructor is held by a dynamic class value is a
corpus program whose output matches Node.

* Assemble a large static-field fence batch without spreading it

The fence helper gets one branch per class and static field, so a program
with a few hundred inheriting classes and two hundred static fields builds a
batch of tens of thousands of entries. Passing that batch as separate
arguments to splice() overflows the engine's argument limit and fails the
compile with 'RangeError: Maximum call stack size exceeded'.

The batch is now assembled into the helper's body in declaration order
without a spread call; successive insertions at the same index left the
branches reversed, and a large-batch test (350 classes x 200 fields) fails on
the old code with the RangeError and passes here.

* Record the TS7 order baselines for the new corpus programs

generic-family-static-write and static-write-inheritance-chain had no
recorded preflight/order baseline, which fails the lint and format job
(test:ts7). Recorded with SCRIPTC_UPDATE_BASELINES=1 against the parity
suite; test:ts7 --baselines-only, format:check and lint pass.

---------

Co-authored-by: yukkes <44968006+yukkes@users.noreply.github.com>
2026-11-29 19:35:59 +00:00
Chris Tateandespetro 238335b211 Name a TypeScript server that exited in the end-of-stream error (#4620)
* Name a TypeScript server that exited in the end-of-stream error

Closes #4382
Co-authored-by: espetro <26749475+espetro@users.noreply.github.com>

* Wait briefly for a closed channel's server exit before reporting it

---------

Co-authored-by: espetro <26749475+espetro@users.noreply.github.com>
2026-11-29 19:35:59 +00:00
Chris Tate 675458265a Read width-copies view map through the IrExpr union (#4622)
- Read the width-copies probe through the expression union.
2026-11-29 19:35:58 +00:00
Chris Tateandmmamedel fe66ac11fb Refuse process.nextTick in library mode (#4628)
process.nextTick lowers to scr_next_tick in scr_async.c, which a sync
library archive does not link. The async_free gate did not name it, so a
library graph could pass SC4005 and produce an archive whose scr_next_tick
reference failed only at the embedder's link. Add it to the refused
prefixes so the graph refuses with SC4005 while preparing the library.

Regression tests cover the call form and the imported nextTick form.

Refs #265

Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
2026-11-29 19:15:20 +00:00
Chris Tate cf944a3e28 Keep queued messages for receiveMessageOnPort after close (#4626)
* Read a closed MessagePort's queue in receiveMessageOnPort

* Bound a closed port's queue once its close notice is sent
2026-11-29 18:18:07 +00:00
Chris Tate b4353ada9d Carry builtin call names as strings in IR expressions (#4627)
* Carry the lib call's builtin name as a string in the IR

* Remove unused libFnSignatures imports in validate and lib-boundary

* Regenerate the IR codec for the string builtin name

* Index the builtin signatures once instead of recasting the table per lookup
2026-11-29 17:39:54 +00:00
Chris Tate 885c5a67d2 Refresh the native compiler profile (#4631) 2026-11-29 17:14:30 +00:00
Chris Tate 5b60dd4ee7 websocket: bound the subprotocol duplicate check (#4624) 2026-11-29 15:55:39 +00:00
Chris Tate 59d5c9662f Treat non-iterable HeadersInit objects as records like Node (#4607)
* Treat non-iterable HeadersInit objects as records like Node

- fetch: read any object's own properties for a HeadersInit record.

* fetch: read a HeadersInit record's values when each conversion comes

* fetch: snapshot a HeadersInit record's keys without reading its values

* fetch: read a HeadersInit record accessor with the object as its this

* fetch: a HeadersInit record includes its non-enumerable own properties
2026-11-29 14:38:31 +00:00
Chris Tate ae4e3f05bf Preserve Windows drive and UNC paths in Node island manifests (#4615) 2026-11-29 14:38:02 +00:00
Chris Tate 7a94c969ab http: destroy(error) on IncomingMessage and ServerResponse (#4494)
* http: destroy(error) on IncomingMessage and ServerResponse

- http: destroy(error) on IncomingMessage and ServerResponse.

* http: pin the destroy(error) late-listener ordering

* http: report destroy(error) to the server's clientError listeners

* http: drop the retained destroy error when its event fires

* http: reject a for-await body with the destroy error
2026-11-29 13:16:59 +00:00
Chris Tate 61883e6416 Project declarations for workspace packages registered as npm-static (#4612)
* Project declarations for workspace packages registered as npm-static

- decl-projection: a workspace package's declarations count as a package's.

* decl-origin: a workspace package's nested package.json is not its root
2026-11-29 13:14:59 +00:00
Chris Tate 28e9752473 Preserve object aliases and shared ArrayBuffers in structuredClone (#4611)
* Preserve object aliases and shared ArrayBuffers in structuredClone

- structuredClone preserves aliases and shares cloned buffers.

* structuredClone keeps its per-call alias tables in identity hash tables

* structuredClone tells a typed array or DataView apart from its ArrayBuffer
2026-11-29 12:58:39 +00:00
Chris Tate aa4ec5519e Guard the fast tier on branches that predate its selector (#4614)
- Guard the fast tier on branches that predate its selector.
2026-11-29 12:58:10 +00:00
Chris Tate 29c7685d84 promises: race over plain entries (#4491)
* promises: race over plain entries

- promises: race over plain entries.

* promises: race joins a dynamic entry that holds a promise

* promises: refuse a dynamic race entry that holds a thenable by name

* promises: trace the value a dynamic race entry settles with

* promises: reject a dynamic race entry whose then read throws

* promises: check a dynamic race entry's fulfillment into the declared type

* promises: evaluate every race entry before resolving a dynamic one
2026-11-29 12:38:38 +00:00
Chris Tate 9c8118482e Make Blob reads iterative, validate before allocating, and open with O_CLOEXEC (#4608)
* Make Blob reads iterative, validate before allocating, and open with O_CLOEXEC

- Blob: ask a source before allocating its bytes on read.

* Blob: hold a validation frame's window across a stack push

* Format tests/harness/blob-fd-cloexec.test.ts

* Blob: validate only the window a slice reads
2026-11-29 12:35:36 +00:00
Chris Tate 5d20261b26 A JS object field another module fills stays checked-dynamic (#4497)
* A JS object field another module fills stays checked-dynamic

- A JS object field another module fills stays checked-dynamic.

* A file-scope binding from a dynamic CommonJS export registers

* A narrowed dynamic receiver converts at the dynamic member call

* Assignments to Error program state lower through their slot handlers

* A checked-dynamic local keeps its narrowed static view in field reads
2026-11-29 12:18:23 +00:00
bd1e35b7f2 Warn about a shared FFI manifest's unused bindings, and document packaging (#4345)
* Warn about a shared FFI manifest's unused bindings, and document packaging

- Warn about a shared FFI manifest's unused bindings, and document packaging.

Co-authored-by: SergiiSharpov <25509495+SergiiSharpov@users.noreply.github.com>
Co-authored-by: espetro <26749475+espetro@users.noreply.github.com>
Fixes #3048
Fixes #3531

* Refuse a manifest name the program implements itself

* ffi: keep an ordinary function named by an unused manifest entry

* ffi: leave a scoped overload set to the program when the entry is unused

* compiler: register the FFI name scan with the whole-program facts

* ffi: poison a call only when its declaration was diagnosed

---------

Co-authored-by: SergiiSharpov <25509495+SergiiSharpov@users.noreply.github.com>
Co-authored-by: espetro <26749475+espetro@users.noreply.github.com>
2026-11-29 11:57:39 +00:00
Chris Tate c1a2a96a5f Lower a push spread over a freshly built source (#4517)
* Lower a push spread over a freshly built source

- array methods: width-coerce a push spread's elements from a fresh source.

* fresh-spread: require the builtin Array.prototype.map, not the name
2026-11-29 11:56:09 +00:00
Chris Tate 0529b64cb3 Invoke Symbol.toPrimitive with string hint during ToString conversion (#4605)
* Invoke Symbol.toPrimitive with string hint during ToString conversion

- Corpus: an object's Symbol.toPrimitive in string conversions.

* ToPrimitive keeps a borrowed receiver alive across the protocol

* DOMException: propagate a failing name or message conversion

* ToString reads a Symbol.toPrimitive getter once

* An explicit toString on a dynamic object answers the inherited tag

* ToPrimitive: keep receiver retained and read getter once in scr_json

* Corpus: a sole-owner Symbol.toPrimitive getter converted through cluster.fork

* Dynamic error views: an explicit toString answers Error.prototype.toString
2026-11-29 11:54:39 +00:00
Chris Tate b7af8ed0a2 Branch on a run-time shell option in execFileSync (#4458)
* Branch on a run-time shell option in execFileSync

- execFileSync's shell option read at call time.

* Format the shell-source binding in the execFileSync lowering

* execFileSync runtime shell: Node's evaluation and validation order

* Corpus: a runtime shell path with an embedded NUL

* execFileSync runtime shell: refuse a shell path with an embedded NUL

* execFileSync runtime shell: an empty shell string launches the file directly
2026-11-29 11:37:33 +00:00
Chris Tate 5469d6f565 ClientRequest.setHeaders accepts a Headers object or a Map (#4526)
* ClientRequest.setHeaders accepts a Headers object or a Map

- http: ClientRequest.setHeaders takes a Headers or Map.

* http: setHeaders checks headersSent before it iterates
2026-11-29 11:36:04 +00:00
Chris Tate 8019316e0a tests: pin the refusal of a void-call result read as a value (#4512)
* tests: pin the refusal of a void-call result read as a value

- tests: pin the refusal of a void-call result read as a value.

* tests: pin parenthesized and for-head void calls as discarded

* tests: pin conditional-statement void arms as discarded

* frontend: refuse a void call's read where the value is dropped or erased

* tests: pin a read conditional arm as refused

* frontend: refuse a void call's read through a callback parameter or alias

* tests: pin the callback parameter read refusal and the kept declaration answer

* frontend: base the void-read refusal on the callee value's declared void type

* tests: pin the destructured, member and optional callback reads

* frontend: keep the refusal for erased callback answers in held slots and indirect callees

* tests: pin the any-slot, element and Map handler reads

* frontend: look through type-only wrappers on a void-typed callee

* tests: pin the non-null asserted callback reads

* frontend: unwrap angle-bracket type assertions on a void-typed callee

* tests: pin the angle-bracket asserted callback read

* frontend: require a non-writable member before an initializer proves undefined

* tests: pin the writable wrapped-initializer member reads

* frontend: refuse a writable member's initializer under a boolean coercion

* tests: pin computed-key and aliased-patch member reads
2026-11-29 11:16:10 +00:00
Chris Tate 5ecb81102b Report OpenSSL ASN.1 error codes for malformed DER private keys (#4606)
* Report OpenSSL ASN.1 error codes for malformed DER private keys

- crypto: answer OpenSSL's ASN.1 errors for malformed private DER.

* crypto: report header and value errors for truncated DER fields
2026-11-29 10:39:35 +00:00
Chris Tate d9c8f2403e process.send serializes records like JSON.stringify (#4523)
* process.send serializes records like JSON.stringify

- child_process: send messages through the JSON walker.

* ipc: keep send's record containers live for the runtime walker
2026-11-29 09:58:03 +00:00
Chris Tate beeed06c60 Give exact-return method adapters a distinct prefix (#4603)
- Give the exact-return method adapter a name source cannot spell.
2026-11-29 09:36:00 +00:00
Chris Tate b57c0c39ae A conditional whole export keeps the members attached to its value (#4514)
* A conditional whole export keeps the members attached to its value

- A conditional whole export keeps the members attached to its value.

* Format the conditional whole-export detector change
2026-11-29 09:18:26 +00:00
Chris Tate df3b773497 worker_threads: give a Worker its listener lists (#4389)
* worker_threads: give a Worker its listener lists

- worker_threads: give a Worker its listener lists.

* worker_threads: drop a worker's event hook with the worker

* worker_threads: detach a Worker's owner hook on both free paths

* worker_threads: keep the owner hook from reading a freed view
2026-11-29 09:04:12 +00:00
Chris Tate 3c513ddda7 Answer typeof for declared-only globals like Node (#4235)
* Answer typeof for declared-only globals like Node

- typeof on a name that is only declared (declare global namespace, declare class, declare enum) with no runtime value returns "undefined" instead of throwing or refusing.
- A differential test covers each declaration form against Node.

* Answer typeof for ambient declarations of Node globals

* Answer a Node global's kind under a computed global write
2026-11-29 08:48:05 +00:00
Chris Tate 7e0e2e3d42 undici: pass TLS connect options, including checkServerIdentity, through to the connection (#4343)
* undici: pass TLS connect options, including checkServerIdentity, through to the connection

- The undici shim's connector hands the caller's TLS options to the TLS dial as undici does, so a certificate-pinning `checkServerIdentity` is applied instead of silently dropped.
- `tls.connect` executes a custom `checkServerIdentity` after chain verification, and a corpus program pins the accepting and rejecting cases against Node.

* tls: give checkServerIdentity a real certificate and Node's verdict rules

* tls: hand the verifier the issuer chain and skip it on a failed chain

* tls: keep a rejected identity rejected after close, and verify the verifier's chain

* native: link the x509 unit wherever TLS links
2026-11-29 08:47:34 +00:00
Chris Tate 3f3bc96404 stream: answer a readable's Symbol.asyncIterator (#4489)
* stream: answer a readable's Symbol.asyncIterator

- stream: answer a readable's Symbol.asyncIterator.

* stream: answer a stream's Symbol.asyncIterator only where nothing else does

* stream: answer Symbol.asyncIterator for live streams, not cached views

* stream: unregister a stream on every destruction path

* stream: free the live-stream table with its last stream

* stream: an own Symbol.asyncIterator answers even when undefined

* stream: a prototype Symbol.asyncIterator answers even when undefined
2026-11-29 08:47:05 +00:00
Chris Tate 8b10aa5cfb tests: pin an awaited void call read by a truthiness test (#4490)
* tests: pin an awaited void call read by a truthiness test

- tests: pin an awaited void call read by a truthiness test.

* frontend: keep a truthiness result's checked-dynamic value in its binding

* frontend: require proof for an awaited call through a void member

* tests: pin the awaited promise member test as refused
2026-11-29 08:46:35 +00:00
Chris Tate d7d02d6abc modules: resolve a literal dynamic import to shipped JS and dispatch its namespace (#4500)
* modules: resolve a literal dynamic import to shipped JS and dispatch its namespace

- modules: resolve a literal dynamic import to shipped JS and dispatch its namespace.

* modules: skip unnamed exports in the namespace dispatch; drop generated entries

* modules: expose an unnamed default through a dynamic namespace

* modules: answer an anonymous default class through the namespace
2026-11-29 08:46:06 +00:00
Chris Tate f61990d925 strings: test a self-append's length inline before the cold check (#4502)
* strings: test a self-append's length inline before the cold check

- strings: test a self-append's length inline before the cold check.

* strings: own a throwing result before its poll, and cover the remaining growth paths

* strings: cover the verifier's attack shapes in the corpus

* strings: evaluate the length check before a frozen write's guard

* strings: check the length before a record or class field write's guard
2026-11-29 08:45:33 +00:00
Chris Tate 9a2dae41c7 test: pin the ML-KEM WebCrypto surface and the hash parameter shapes (#4508)
* test: pin the ML-KEM WebCrypto surface and the hash parameter shapes

- test: pin the ML-KEM WebCrypto surface and the hash parameter shapes.

* test: scope the ML-KEM ledger entry to the rows its corpus proves

* test: leave the ContextParams context row unclaimed
2026-11-29 08:45:04 +00:00
Chris Tate 961b4c39a3 tests: run the new corpus program on the wasm32 lane (#4511)
* tests: run the new corpus program on the wasm32 lane

- tests: run the new corpus program on the wasm32 lane.

* array: call a field or refuse a wrapped override on base-typed calls

* array: instantiate a generic override from the inherited signature

* array: refuse a base-typed generic override under a prototype redefinition
2026-11-29 08:44:35 +00:00
Chris Tate 85844f97bb Unions with checked-dynamic members in spreads and destructuring (#4520)
* Unions with checked-dynamic members in spreads and destructuring

- Join a checked-dynamic answer in a union destructuring.

* Collapse equal union arms after unregistered classes become f64

* Read an absent optional checked-dynamic field as undefined

* Read an absent optional checked-dynamic field through a union projection as undefined
2026-11-29 08:44:03 +00:00