mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-14 04:54:12 +08:00
pi's compatibility shims patch host objects — `process.stdout.write = fn` to capture output, `.bind()` on a native function, `Object.defineProperty` on a module export. A compiled binary has no host object to patch: the natives are direct calls, so these sites keep an explicit refusal instead of compiling to something that silently diverges from Node. tests/diagnostics/native-shim-monkeypatching.ts pins the three shapes (SC1090 assignment to a non-variable, SC2007 on a valued overload set, SC2020 for defineProperty on an import), so the boundary is visible and any future process-object model has to update it deliberately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>