MCPcopy Create free account
hub / github.com/TruthHun/BookStack / setBounds

Function setBounds

static/word2md/mammoth.browser.js:5328–5368  ·  view source on GitHub ↗
(firstLineError, lastLineError)

Source from the content-addressed store, hash-verified

5326}
5327
5328function setBounds(firstLineError, lastLineError) {
5329 if (!longStackTracesIsSupported()) return;
5330 var firstStackLines = firstLineError.stack.split("\n");
5331 var lastStackLines = lastLineError.stack.split("\n");
5332 var firstIndex = -1;
5333 var lastIndex = -1;
5334 var firstFileName;
5335 var lastFileName;
5336 for (var i = 0; i < firstStackLines.length; ++i) {
5337 var result = parseLineInfo(firstStackLines[i]);
5338 if (result) {
5339 firstFileName = result.fileName;
5340 firstIndex = result.line;
5341 break;
5342 }
5343 }
5344 for (var i = 0; i < lastStackLines.length; ++i) {
5345 var result = parseLineInfo(lastStackLines[i]);
5346 if (result) {
5347 lastFileName = result.fileName;
5348 lastIndex = result.line;
5349 break;
5350 }
5351 }
5352 if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||
5353 firstFileName !== lastFileName || firstIndex >= lastIndex) {
5354 return;
5355 }
5356
5357 shouldIgnore = function(line) {
5358 if (bluebirdFramePattern.test(line)) return true;
5359 var info = parseLineInfo(line);
5360 if (info) {
5361 if (info.fileName === firstFileName &&
5362 (firstIndex <= info.line && info.line <= lastIndex)) {
5363 return true;
5364 }
5365 }
5366 return false;
5367 };
5368}
5369
5370function CapturedTrace(parent) {
5371 this._parent = parent;

Callers

nothing calls this directly

Calls 2

parseLineInfoFunction · 0.70

Tested by

no test coverage detected