Skip to content

Instantly share code, notes, and snippets.

@yocontra
Created April 24, 2012 07:31
Show Gist options
  • Save yocontra/2477488 to your computer and use it in GitHub Desktop.
Save yocontra/2477488 to your computer and use it in GitHub Desktop.
Coffeescript override __bind to track function scope
@['__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