Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 41 additions & 37 deletions tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,54 +1071,58 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
parts,
item,
source;
try {
for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {
if (curr === computeStackTrace || curr === TraceKit.report) {
continue;
}

for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) {
if (curr === computeStackTrace || curr === TraceKit.report) {
continue;
}
item = {
'url': null,
'func': UNKNOWN_FUNCTION,
'args': [],
'line': null,
'column': null
};

item = {
'url': null,
'func': UNKNOWN_FUNCTION,
'args': [],
'line': null,
'column': null
};
if (curr.name) {
item.func = curr.name;
} else if ((parts = functionName.exec(curr.toString()))) {
item.func = parts[1];
}

if (curr.name) {
item.func = curr.name;
} else if ((parts = functionName.exec(curr.toString()))) {
item.func = parts[1];
}
if (typeof item.func === 'undefined') {
try {
item.func = parts.input.substring(0, parts.input.indexOf('{'));
} catch (e) { }
}

if (typeof item.func === 'undefined') {
try {
item.func = parts.input.substring(0, parts.input.indexOf('{'));
} catch (e) { }
}
if ((source = findSourceByFunctionBody(curr))) {
item.url = source.url;
item.line = source.line;

if ((source = findSourceByFunctionBody(curr))) {
item.url = source.url;
item.line = source.line;
if (item.func === UNKNOWN_FUNCTION) {
item.func = guessFunctionName(item.url, item.line);
}

if (item.func === UNKNOWN_FUNCTION) {
item.func = guessFunctionName(item.url, item.line);
var reference = / '([^']+)' /.exec(ex.message || ex.description);
if (reference) {
item.column = findSourceInLine(reference[1], source.url, source.line);
}
}

var reference = / '([^']+)' /.exec(ex.message || ex.description);
if (reference) {
item.column = findSourceInLine(reference[1], source.url, source.line);
if (funcs['' + curr]) {
recursion = true;
} else {
funcs['' + curr] = true;
}
}

if (funcs['' + curr]) {
recursion = true;
}else{
funcs['' + curr] = true;
stack.push(item);
}

stack.push(item);
}
}
catch (error) {

}

if (depth) {
stack.splice(0, depth);
Expand Down