Files
scriptc/tests/corpus/2441-console-process-argv.ts
Chris Tate 7c93ab6505 Console prints every inspectable shape with Node's console semantics
- 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
2026-07-23 01:28:47 -05:00

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));