jiagra
jiagra copied to clipboard
capturing stack trace
LOL
// You know, you could always just do:
var stack = new Error().stack
// Instead of:
var stack;
try {
omgwtf
} catch(e) {
stack = e.stack;
}
But +1 for style!
IIRC, some browsers (cough Safari cough) only have the stack property set after the Error object is thrown. You know... because Safari is awesome like that. :wink: