Skip to content

Instantly share code, notes, and snippets.

@LeZuse
Created July 12, 2012 22:05
Show Gist options
  • Select an option

  • Save LeZuse/3101388 to your computer and use it in GitHub Desktop.

Select an option

Save LeZuse/3101388 to your computer and use it in GitHub Desktop.
V8: stack trace
Error.stackTraceLimit = Infinity;
// Called before getting the stack property
Error.prepareStackTrace = function(e,s){
console.log(e,s);
};
// "Error" object
var a = {toString:function()
{
return 'Custom error';
}};
Error.captureStackTrace(a);
console.log(a.stack);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment