fix log.debug in IE

This commit is contained in:
Matias Alejo Garcia 2014-12-30 09:41:52 -03:00
parent 74541c6f7b
commit ffe1b8e149
1 changed files with 8 additions and 1 deletions

View File

@ -49,7 +49,14 @@ _.each(levels, function(level, levelName) {
if (Error.stackTraceLimit && this.level == 'debug') {
var old = Error.stackTraceLimit;
Error.stackTraceLimit = 2
var stack = new Error().stack;
var stack;
// this hack is to be compatible with IE11
try {
anerror();
} catch (e) {
stack = e.stack;
}
var lines = stack.split('\n');
var caller = lines[2];
caller = ':' + caller.substr(6);