(obj)
| 278 | }; |
| 279 | |
| 280 | const prettyPrint = function (obj) { |
| 281 | if (obj == null) return "null"; |
| 282 | |
| 283 | let result; |
| 284 | |
| 285 | if (Element.prototype.isPrototypeOf(obj)) { |
| 286 | result = |
| 287 | '<<span class="token tagname">' + |
| 288 | obj.tagName.toLowerCase() + |
| 289 | "</span>"; |
| 290 | for (const attr of Array.from(obj.attributes)) { |
| 291 | if (attr.specified) |
| 292 | result += |
| 293 | ' <span class="token attr">' + |
| 294 | attr.nodeName + |
| 295 | '</span>=<span class="token string">"' + |
| 296 | truncate(attr.textContent, 10) + |
| 297 | '"</span>'; |
| 298 | } |
| 299 | result += ">"; |
| 300 | return result; |
| 301 | } else if (obj.call) { |
| 302 | if (obj.hyperfunc) result = "def " + obj.hypername + " ..."; |
| 303 | else result = "function " + obj.name + "(...) {...}"; |
| 304 | } else if (obj.toString) { |
| 305 | result = obj.toString(); |
| 306 | } |
| 307 | |
| 308 | return escapeHTML((result || "undefined").trim()); |
| 309 | }; |
| 310 | |
| 311 | const getCounter = function () { |
| 312 | return hdbCounter; |
no test coverage detected