Files
scriptc/tests/corpus/2164-js-then-dyn-handler.cjs
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

29 lines
871 B
JavaScript

// `.then(handler)` with a CHECKED-DYNAMIC handler VALUE (the Node-suite
// `p.then(common.mustCall())` shape): the settled value crosses into the
// handler through the checked-dynamic tree (void settles deliver JS's explicit undefined
// argument), rejections pass through to a chained .catch, and the traced
// microtask ordering matches Node's.
'use strict';
function mustCallish(fn) {
return function (...args) { return fn.apply(this, args); };
}
async function work() {
return 7;
}
async function quiet() {}
work().then(mustCallish((v) => { console.log('value', v); }));
quiet().then(mustCallish((v) => { console.log('void-settle', v, typeof v); }));
async function fails() {
throw new Error('nope');
}
fails()
.then(mustCallish(() => { console.log('unreachable'); }))
.catch((e) => { console.log('caught', String(e)); });
console.log('sync tail');