Files
scriptc/tests/fixtures/self-hosting/validate.ts
Chris Tate 4427f1fb5a Expand native collection keys and construction
- Support boolean, bigint, and mixed value keys in native Maps and Sets.
- Reuse key hashes and copy collections directly into compact storage.
- Preserve collection identity, ordering, iteration, and ownership behavior.
2026-10-05 09:32:14 -05:00

11 lines
632 B
TypeScript

import { readFileSync } from "node:fs";
import type { IrModule } from "../../../packages/compiler/src/ir/ir.js";
import { validateModule } from "../../../packages/compiler/src/ir/validate.js";
import { deserializeModule } from "../../../packages/compiler/src/ir/serialize.js";
// Raw cases probe validation independently of the reviver. Emitted IR
// needs its numeric sentinels revived before the checked typed boundary.
const input = readFileSync(process.argv[2]!, "utf8");
const mod = process.argv[3] === "serialized" ? deserializeModule(input) : JSON.parse(input) as IrModule;
console.log(JSON.stringify(validateModule(mod)));