MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / error

Method error

src/client/sandbox.mjs:244–258  ·  view source on GitHub ↗
(exception)

Source from the content-addressed store, hash-verified

242 }
243
244 error(exception) {
245 if (!this.output) throw exception
246 let stack = parseStack(exception.stack)
247 this.output.out("error", [String(exception) + (stack.length ? " (" + frameString(stack[0]) + ")" : "")])
248 if (stack.length > 1) {
249 this.output.div.lastChild.appendChild(document.createTextNode(" "))
250 let mark = this.output.div.lastChild.appendChild(document.createElement("span"))
251 mark.innerHTML = "…"
252 mark.className = "sandbox-output-etc"
253 mark.addEventListener("click", () => {
254 mark.className = ""
255 mark.innerHTML = "\n called from " + stack.slice(1).map(frameString).join("\n called from ")
256 })
257 }
258 }
259
260 clearEvents() {
261 while (this.timeouts.length) this.win.clearTimeout(this.timeouts.pop())

Callers 6

runMethod · 0.95
setupEnvMethod · 0.95
addSolutionFunction · 0.80
chapter_info.mjsFile · 0.80
errorFunction · 0.80
preprocessFunction · 0.80

Calls 3

parseStackFunction · 0.85
frameStringFunction · 0.85
outMethod · 0.45

Tested by

no test coverage detected