mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
- console.log/info/debug/error/warn take unknown[] and render every non-scalar argument through the static util.inspect at the rest-args depth 2, strings verbatim - top-level unions dispatch per arm at runtime with string arms raw, and util.format's %s/rest args take the same per-arm rule - info and debug lower as stdout aliases of log; the remaining stock console members are declared in the fallback so stock-clean programs meet per-site SC2020 hints instead of a fallback-manufactured SC0001 - corpus 2440/2441 pin the widened shapes on both backends, console.log(process.argv), a find() miss union, and console.log(undefined) included - diagnostics snapshots re-pinned: the union console fences retire and utility-types reports its real per-site fences
14 lines
533 B
TypeScript
14 lines
533 B
TypeScript
// console.log(process.argv) — the string[] report shape. argv[0]/argv[1]
|
|
// VALUES differ between Node and scriptc (documented divergence; length
|
|
// and positions match), so the fixture normalizes the two entries through
|
|
// argv's own mutability (ONE interned array, like Node) before printing
|
|
// the array itself.
|
|
const argv = process.argv;
|
|
console.log(argv.length);
|
|
argv[0] = "runtime";
|
|
argv[1] = "program";
|
|
console.log(process.argv);
|
|
argv.push("--flag", "value");
|
|
console.log(process.argv);
|
|
console.log(process.argv.slice(2));
|