Last active
May 12, 2017 17:54
-
-
Save roblevintennis/231d72ebe85013011b85254dac2057c4 to your computer and use it in GitHub Desktop.
coffeescript stack trace
This file contains 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
getStackTrace = -> | |
stack = (new Error).stack or '' | |
stack = stack.split('\n').map((line) -> | |
line.trim() | |
) | |
stack.splice if stack[0] == 'Error' then 2 else 1 | |
onRender: -> | |
console.log("Custom stack trace:") | |
console.log(getStackTrace().join('\n')) | |
# The following works fine too, you just end up seeing absolutely every call in the stack trace | |
console.log("console.trace: ") | |
console.trace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment