mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +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.
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
// console.log over checked-dynamic values: Node's console formatter for a
|
|
// non-format argument — strings VERBATIM, everything else through inspect
|
|
// at the rest-args depth 2. Scalar kinds byte-exact (-0 included), boxed
|
|
// functions as [Function: name] / [Function (anonymous)], composites
|
|
// through the dyn walk with the 100-item truncation and the depth-2
|
|
// placeholders. console.log never throws.
|
|
'use strict';
|
|
let d = JSON.parse('{"a":1,"b":[1,2,{"c":"x"}],"s":"str"}');
|
|
console.log(d);
|
|
console.log('mix', d, 5, 'end');
|
|
console.log(d.a, d.s);
|
|
console.log(d.b);
|
|
|
|
let arr = JSON.parse('[1,"two",true,null]');
|
|
console.log(arr);
|
|
console.log(JSON.parse('-0'));
|
|
console.log(JSON.parse('"plain string prints verbatim"'));
|
|
console.log(JSON.parse('null'), JSON.parse('true'));
|
|
|
|
let deep = JSON.parse('{"a":{"b":{"c":{"d":1}}}}');
|
|
console.log(deep);
|
|
|
|
let big = JSON.parse('[' + Array.from({ length: 130 }, (_, i) => i).join(',') + ']');
|
|
console.log(big);
|
|
|
|
let f = (a) => a;
|
|
console.log(f);
|
|
console.log(function named(a) { return a; });
|
|
console.log((a) => a);
|
|
let obj = JSON.parse('{}');
|
|
let empt = JSON.parse('[]');
|
|
console.log(obj, empt);
|