mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
A path family read by untyped code is a plain object holding Node's members in Node's order, built once per family and kept in the builtin-module registry. Object.keys, Object.entries, Object.assign, spreads, for-in and own-property checks over it see those members. path.posix.posix and the cross-family members refer to the registered objects; the registry releases their members at exit through the objects' own storage. Every builtin function value that becomes untyped boxes as its checked twin, under the builtin's name and length, after lowering: a module object's member, an assertion's argument, and a read of a binding whose only stores are that builtin (a const local, or a module-level binding). `ns.join === path.posix.join` holds for an untyped path namespace, and `const join = path.join` passed to an untyped function compares equal to path.join and validates its arguments with Node's errors. The lowerer journals the checked-twin table (each builtin's data, display name and location), so a unit replayed from the journal keeps its twins.