Files
scriptc/tests/corpus/3083-set-string-seed.ts
Chris Tate 8e95bcbe7f feat(compiler): advance native validator self-hosting (#492)
- Support mutable forward captures with correct initialization and exception behavior.
- Compile recursive literals, exhaustive bindings, and validator collection operations statically.
- Run validator control-flow analysis natively with C and LLVM differential coverage.
2026-09-27 12:14:06 -05:00

21 lines
755 B
TypeScript

export {};
function inspect(input: string): void {
const values = new Set(input);
console.log(JSON.stringify(input), values.size, JSON.stringify([...values]));
console.log(values.has("a"), values.has("😀"), values.has("é"));
values.add("a");
values.delete("😀");
values.add("😀");
console.log(JSON.stringify([...values]));
}
for (const input of ["", "abba", "😀a😀b", "e\u0301é", "\uD800\uDC00\uD800\uDC00", "a\0a\0b"]) {
inspect(input);
}
let calls = 0;
function seed(): string { calls++; return "abac"; }
const constructed = new Set<string>(seed());
console.log("once", calls, [...constructed].join(""));
const flags: ReadonlySet<string> = new Set("gimig");
console.log("flags", flags.size, flags.has("g"), flags.has("u"));