Files
scriptc/tests/fixtures/strictness/json-any/main.ts
Chris Tate 6b6445ab90 Retire the "DOM" nickname in comments, internal docs, and message prose: the checked-dynamic tree / dyn values
- The ratified rename rider (world-unification §7 lane 5): "DOM" collided with the browser DOM and, post-lane-1, the structure is no longer a document tree. Comments and doc prose now say "the checked-dynamic tree" for the noun and "dyn" adjectivally; runtime symbol names (scr_dyn_*), the error.domClone libCall, and the real web DOMException family are unchanged.
- The few user-facing strings carrying the nickname move with it (the structuredClone cyclic message, the dc subscriber/publish fences, two emitter ICE texts); diagnostics snapshots regenerated (96 pass). One private compiler constant (DOM_PROTO_METHOD_NAMES -> DYN_PROTO_METHOD_NAMES) rides along.
- Mechanical sweep, 142 files, comments/prose only — no behavior change.
2026-07-24 11:14:58 -05:00

23 lines
1.0 KiB
TypeScript

/* Leans on the standard lib's any-typed JSON.parse (property reads straight
* off the result, no checked cast) and rejects a Promise with a STRING
* reason — both clean under this project's OWN tsc, both re-typed by
* scriptc's divergence overrides (parse(): unknown; reject pins
* `(reason: Error) => void`). Pins preflight's project-world second chance:
* this program is ANALYZABLE (never a SC0001 wall). The unknown reads
* LOWER now (the dyn keyed read, corpus 1544); what still fails at
* lowering is the override-affected reject — the reason-coercion fence
* for the string reason. A bound reject called with an Error is the
* SUPPORTED surface and lowers cleanly. */
const pkg = JSON.parse('{"name":"demo"}');
if (typeof pkg.name === "string") {
console.log(pkg.name);
}
const p: Promise<string> = new Promise((resolve, reject) => {
resolve("done");
reject(new Error("unused"));
});
const q: Promise<string> = new Promise((resolve, reject) => {
reject("a bare string reason");
});
console.log("end");