MCPcopy
hub / github.com/SeleniumHQ/selenium / extractStacktrace

Function extractStacktrace

third_party/js/qunit/qunit.js:1503–1526  ·  view source on GitHub ↗
(e, offset)

Source from the content-addressed store, hash-verified

1501 // leaving only "qunit.js".
1502 .replace(/.+[/\\]/, '');
1503 function extractStacktrace(e, offset) {
1504 offset = offset === undefined ? 4 : offset;
1505
1506 // Support: IE9, e.stack is not supported, we will return undefined
1507 if (e && e.stack) {
1508 var stack = e.stack.split('\n');
1509 if (/^error$/i.test(stack[0])) {
1510 stack.shift();
1511 }
1512 if (fileName) {
1513 var include = [];
1514 for (var i = offset; i < stack.length; i++) {
1515 if (stack[i].indexOf(fileName) !== -1) {
1516 break;
1517 }
1518 include.push(stack[i]);
1519 }
1520 if (include.length) {
1521 return include.join('\n');
1522 }
1523 }
1524 return stack[offset];
1525 }
1526 }
1527 function sourceFromStacktrace(offset) {
1528 var error = new Error();
1529

Callers 5

sourceFromStacktraceFunction · 0.85
stackFunction · 0.85
qunit.jsFile · 0.85
runHookFunction · 0.85
rejectFunction · 0.85

Calls 3

splitMethod · 0.80
joinMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected