Files
scriptc/tests/corpus/array-optional-number-write-index.ts
Chris Tate ee9f0d64eb feat: ship the self-hosted native scriptc CLI (#585)
* feat: ship the self-hosted native scriptc CLI

- Run the shared compiler and CLI natively, including library builds and compile-time evaluation.
- Install native platform packages and ship relocatable standalone distributions.
- Preserve program semantics and reuse validated build artifacts for fast rebuilds.

* fix: complete native CLI integration and validation

- Preserve library diagnostics and run recursive compiler work on the main stack.
- Restore packaged helper permissions and exercise native npm and Wasm library builds.
- Recover interrupted Sandbox status probes within the original command deadline.
2026-09-30 02:17:56 -05:00

13 lines
492 B
TypeScript

const order = [2, 0, 1];
const mapped: number[] = new Array<number>(3).fill(-1);
order.forEach((oldIndex, newIndex) => { mapped[oldIndex] = newIndex; });
console.log(mapped.join(","));
const candidates = new Map<string, number[]>();
candidates.set("entry", [1, 2]);
const included = new Array<boolean>(3).fill(false);
for (const candidate of candidates.get("entry") ?? new Array<number>()) {
if (included[candidate] !== true) included[candidate] = true;
}
console.log(included.join(","));