Created
April 30, 2014 23:00
-
-
Save eriwen/32501633f60891847d8f to your computer and use it in GitHub Desktop.
Error.prepareStackTrace idea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error.prepareStackTrace = function(error, stack) { | |
var stackEntries = []; | |
for(var i = 1, len = stack.length; i < len; i++) { | |
var cur = stack[i]; | |
// IDEA: utilize getEvalOrigin: if this function was created using a call to eval returns a CallSite object representing the location where eval was called | |
if (!cur.isNative()) { | |
stackEntries.push(new StackEntry(cur.getFunctionName(), cur.getFileName(), cur.getLineNumber(), cur.getColumnNumber())); | |
} | |
} | |
return stackEntries; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment