MCPcopy Create free account
hub / github.com/9miao/CrossApp / debugObject

Function debugObject

scripting/javascript/bindings/js/jsb_debugger.js:455–486  ·  view source on GitHub ↗
(r, isNormal)

Source from the content-addressed store, hash-verified

453};
454
455var debugObject = function (r, isNormal) {
456 var stringres = "";
457 try {
458 stringres += "* " + (typeof r) + "\n";
459 if (typeof r != "object") {
460 stringres += "~> " + r + "\n";
461 } else {
462 var props;
463 if (isNormal) {
464 props = Object.keys(r);
465 } else {
466 props = r.getOwnPropertyNames();
467 }
468 for (k in props) {
469 var desc = r.getOwnPropertyDescriptor(props[k]);
470 stringres += "~> " + props[k] + " = ";
471 if (desc.value) {
472 stringres += "" + desc.value;
473 } else if (desc.get) {
474 stringres += "" + desc.get();
475 } else {
476 stringres += "undefined (no value or getter)";
477 }
478 stringres += "\n";
479 }
480 }
481
482 return stringres;
483 } catch (e) {
484 return ("Exception when accessing object properties = " + e);
485 }
486}
487
488dbg.breakLine = 0;
489

Callers 1

jsb_debugger.jsFile · 0.85

Calls 2

keysMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected