Files
Chris Tate 871284a382 Mutable-default snapshots, npm named re-exports, and perf_hooks performance.now
- export default <mutable let> registers Node's snapshot as const storage keyed by the default alias symbol; resolveValueSymbol's default-hop walk stops importer reads there instead of chasing to the live let (corpus 2426 pins the snapshot/live split against export { x as default })
- named re-exports from installed npm packages lower as import-plus-export plumbing: the island load registers at the statement's position and bindings key the aliased symbols direct imports use (npm case npm-reexport covers named, renamed, CJS, and as-default spellings)
- node:perf_hooks joins the supported builtins: performance.now() lowers to scr_perf_now (the uptime anchor's monotonic clock, fractional ms), and performance.now.bind(performance) lowers as a () => number function value (corpus 2427); both backends
2026-07-22 23:21:59 -05:00

13 lines
353 B
TypeScript

// `export default <mutable identifier>` — Node SNAPSHOTS the value when the
// export statement runs; later writes to the let stay invisible through the
// importer's default binding (the named exports below stay LIVE).
let v = 1;
v = v + 1;
export default v;
export function bump(): void {
v = 99;
}
export function read(): number {
return v;
}