Files
scriptc/tests/corpus/2579-jsval-object-param-crossing.js
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

47 lines
1.4 KiB
JavaScript

// @dynamic
// The repro-2 shape without npm: a JSDoc `@param {object}` slot is
// checked-dynamic, and an 'any'-typed engine value flowing into it
// CONVERTS (the jsval→dyn wrap) instead of fencing — prettier's
// getSupportInfo({ plugins = [] } = {}) family. The wrapped member also
// rides a dyn object literal and destructures back out, and the armed
// rows answer through the engine.
/** @returns {any} */
function mint() {
return { languages: [{ name: "js" }], flag: true };
}
const plug = mint();
/** @param {object} options */
function probeDirect(options) {
console.log("typeof:", typeof options);
console.log("truthy:", options ? "yes" : "no");
console.log("str:", String(options));
}
probeDirect(plug);
/**
* @param {object} param0
*/
function probeBag({ plugins = [], tag = "none" } = {}) {
console.log("member typeof:", typeof plugins);
console.log(`tag: ${tag}`);
return plugins;
}
const out = probeBag({ plugins: plug, tag: "t1" });
// The member survives the literal + destructuring round trip as the SAME
// engine value (=== through two independent wraps).
/**
* @param {unknown} a
* @param {unknown} b
*/
function same(a, b) {
return a === b;
}
console.log("same value:", same(out, plug));
// The default arm still fires for an absent member (the wrap never
// disturbs the nullish test on real dyn kinds).
probeBag({ tag: "t2" });
probeBag();