mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +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.
16 lines
960 B
JavaScript
16 lines
960 B
JavaScript
// Object.keys/values/entries over CHECKED-DYNAMIC objects (the JS
|
|
// file-scope object-literal identity story): the runtime walks the checked-dynamic tree
|
|
// node's own keys in JS own-key order (array-index keys ascending
|
|
// first); null/undefined throw Node's catchable TypeError. This was an
|
|
// ICE before the walk existed (the record helper received a dyn value).
|
|
'use strict';
|
|
const eventPhases = { 'NONE': 0, 'CAPTURING_PHASE': 1, 'AT_TARGET': 2, 'BUBBLING_PHASE': 3 };
|
|
console.log(JSON.stringify(Object.keys(eventPhases)));
|
|
console.log(JSON.stringify(Object.values(eventPhases)));
|
|
console.log(JSON.stringify(Object.entries(eventPhases)));
|
|
const mixed = { b: 'x', '2': 'two', a: 'y', '0': 'zero' };
|
|
console.log(JSON.stringify(Object.keys(mixed)));
|
|
console.log(JSON.stringify(Object.entries(mixed)));
|
|
try { Object.keys(null); } catch (e) { console.log(e.name, e.message); }
|
|
try { Object.entries(undefined); } catch (e) { console.log(e.name, e.message); }
|