mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +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.
29 lines
871 B
JavaScript
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');
|