mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-17 05:09:24 +08:00
- 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.
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
// @exit: 1
|
|
// Checked-dynamic asserts INSIDE node:test bodies — untyped JS's most
|
|
// common assert form running where it matters: strictEqual(dynValue,
|
|
// scalar) passes and fails with Node's exact AssertionError messages in
|
|
// the failing section (the generated multi-line diff included), the
|
|
// deep pair walks the checked-dynamic tree against static literals, and truthiness rides
|
|
// assert(dynValue).
|
|
import assert from "node:assert";
|
|
import { test } from "node:test";
|
|
|
|
const cfg: unknown = JSON.parse('{"port":8080,"host":"localhost","tags":["a","b"],"debug":false}');
|
|
const port: unknown = JSON.parse("8080");
|
|
|
|
test("dyn scalar assertions pass", () => {
|
|
assert.strictEqual(port, 8080);
|
|
assert.notStrictEqual(port, 8081);
|
|
assert(port);
|
|
});
|
|
|
|
test("dyn deep assertions pass", () => {
|
|
assert.deepStrictEqual(cfg, {
|
|
port: 8080,
|
|
host: "localhost",
|
|
tags: ["a", "b"],
|
|
debug: false,
|
|
});
|
|
assert.notDeepStrictEqual(cfg, { port: 8080 });
|
|
});
|
|
|
|
test("failing dyn strictEqual", () => {
|
|
assert.strictEqual(port, "8080");
|
|
});
|
|
|
|
test("failing dyn deepStrictEqual", () => {
|
|
assert.deepStrictEqual(cfg, {
|
|
port: 8081,
|
|
host: "localhost",
|
|
tags: ["a", "b"],
|
|
debug: false,
|
|
});
|
|
});
|