MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / trace

Function trace

demo/debugger.js:549–567  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

547 var output = $("debugger-output");
548
549 function trace(msg) {
550 if (typeof msg === "object") {
551 var obj = {};
552 for (var field in msg) {
553 if (typeof msg[field] !== "function") {
554 obj[field] = msg[field].toString();
555 } else {
556 obj[field] = "[function Function]";
557 }
558 }
559 msg = JSON.stringify(obj, undefined, 2);
560 } else if (msg === undefined) {
561 msg = "[undefined]";
562 } else if (typeof msg !== "string") {
563 msg = msg.toString();
564 }
565 var lines = msg.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/ /g, "&nbsp;").split("\n");
566 output.innerHTML = lines.join("<br>") + "<br>" + output.innerHTML;
567 };
568 window.trace = trace;
569 $("debugger-input-area").addEventListener("keydown", function(e) {
570 if (e.keyCode == 9) e.preventDefault()

Callers 3

bindFunction · 0.70
bindResizeFunction · 0.70
bindDebuggerFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected