Created
April 24, 2012 07:31
-
-
Save yocontra/2477488 to your computer and use it in GitHub Desktop.
Coffeescript override __bind to track function scope
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
@['__bind'] = (fn, scope) -> | |
nu = -> | |
fn.apply scope, arguments | |
(nu._scope?=[]).push scope | |
return nu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment