MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / wrapForError

Function wrapForError

src/run_tests.mjs:37–41  ·  view source on GitHub ↗
(snippet, message)

Source from the content-addressed store, hash-verified

35}
36
37function wrapForError(snippet, message) {
38 return "try { (function() {\n" + snippet + "})();\n" +
39 "console.missingErr()\n} catch (_e) { console.compareErr(_e, " +
40 JSON.stringify(message) + ") }\n"
41}
42
43function pos(index) {
44 return "line " + (input.slice(0, index).split("\n").length + 1)

Callers 1

run_tests.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected