Files
scriptc/docs
Chris Tate d10ddff548 Compile createRequire probes for optional addons as deferred refusals
Packages such as pi-tui look for their prebuilt Node-API addons at run
time: a createRequire require call with a computed path, and the
loader's resolve passed as a value, each inside a try block whose catch
takes a fallback. Preflight refused these packages.

Preflight now classifies each use of a createRequire loader. Inside the
try block of a try statement in the same function, a call with a
computed specifier or another argument shape, and resolve or
resolve.paths read as a value, no longer refuse the package. Outside a
try block they keep it refused, with a reason that names the computed
specifier. The loader itself as a value, writes and optional calls stay
refused.

In JavaScript source, such a call evaluates its arguments and then
throws a runtime fence, and the resolve value is a function that throws
one when called, so `(options.resolve ?? require.resolve)(id)` still
calls the option. Both are listed in coverage as deferred to runtime.
TypeScript source keeps the compile-time refusals.

Refs #1777
2026-10-23 11:36:23 -05:00
..
2026-07-22 18:08:04 -05:00
2026-10-02 00:58:25 -05:00
2026-10-02 00:58:25 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00