mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
- 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.
11 lines
632 B
TypeScript
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)));
|