Take into account that there's an extra 1st frame in Chrome only

This commit is contained in:
Zalmoxisus 2018-12-13 23:54:38 +02:00
parent 4acf9eed83
commit 651df1a077

View File

@ -50,7 +50,9 @@ export const ActionCreators = {
stack = error.stack;
if (typeof Error.stackTraceLimit !== 'number' || Error.stackTraceLimit > traceLimit) {
frames = stack.split('\n');
if (frames.length > traceLimit) stack = frames.slice(0, traceLimit + 1).join('\n'); // +1 for `Error\n`
if (frames.length > traceLimit) {
stack = frames.slice(0, traceLimit + (frames[0] === 'Error' ? 1 : 0)).join('\n');
}
}
}
}