Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Created February 7, 2012 20:46
Show Gist options
  • Save kriskowal/1761838 to your computer and use it in GitHub Desktop.
Save kriskowal/1761838 to your computer and use it in GitHub Desktop.
/*
Error
at treachery (hell.js:49:11)
at fraud (hell.js:45:12)
at violence (hell.js:41:12)
at heresy (hell.js:37:12)
at anger (hell.js:33:12)
at greed (hell.js:29:12)
at gluttony (hell.js:25:12)
at lust (hell.js:21:12)
at limbo (hell.js:17:12)
*/
limbo()
function limbo() {
return lust();
}
function lust() {
return gluttony();
}
function gluttony() {
return greed();
}
function greed() {
return anger();
}
function anger() {
return heresy();
}
function heresy() {
return violence();
}
function violence() {
return fraud();
}
function fraud() {
return treachery();
}
function treachery() {
throw new Error;
}
@paulmillr
Copy link

no chance to repro this with coffee

limbo = -> lust()
lust = -> gluttony()
gluttony = -> greed()
greed = -> anger()
anger = -> heresy()
heresy = -> violence()
violence = -> fraud()
fraud = -> treachery()
treachery = -> throw new Error
limbo()
Error
    at shit.coffee:37:11
    at shit.coffee:33:12
    at shit.coffee:29:12
    at shit.coffee:25:12
    at shit.coffee:21:12
    at shit.coffee:17:12
    at shit.coffee:13:12
    at shit.coffee:9:12
    at shit.coffee:5:12
    at Object.<anonymous> (shit.coffee:40:3)

@pmuellr
Copy link

pmuellr commented Feb 7, 2012

Clearly, this works better as a Class:

class FavoriteThings
    limbo:     -> @lust()
    lust:      -> @gluttony()
    gluttony:  -> @greed()
    greed:     -> @anger()
    anger:     -> @heresy()
    heresy:    -> @violence()
    violence:  -> @fraud()
    fraud:     -> @treachery()
    treachery: -> throw new Error

new FavoriteThings().limbo()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment