MCPcopy Create free account
hub / github.com/GNOME/gjs / dvToString

Function dvToString

modules/script/_bootstrap/debugger.js:33–42  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

31
32// Convert a debuggee value v to a string.
33function dvToString(v) {
34 if (typeof v === 'undefined')
35 return 'undefined'; // uneval(undefined) === '(void 0)', confusing
36 if (typeof v === 'object' && v !== null)
37 return `[object ${v.class}]`;
38 const s = uneval(v);
39 if (s.length > 400)
40 return `${s.substr(0, 400)}...<${s.length - 400} more bytes>...`;
41 return s;
42}
43
44// Build a nested tree of all private fields wherever they reside. Each level has KV tuples and their descendents:
45// {cur: [[key1, value1], ...], children: {key1: {...next level}}}

Callers 3

debuggeeValueToStringFunction · 0.85
evalInFrameFunction · 0.85
keysCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected