Skip to content

Instantly share code, notes, and snippets.

@eriwen
Created April 30, 2014 23:00
Show Gist options
  • Save eriwen/32501633f60891847d8f to your computer and use it in GitHub Desktop.
Save eriwen/32501633f60891847d8f to your computer and use it in GitHub Desktop.
Error.prepareStackTrace idea
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