Created
April 5, 2012 08:59
-
-
Save rlidwka/2309325 to your computer and use it in GitHub Desktop.
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
class WrapFunc | |
constructor: -> | |
for key of @ | |
do (key) => | |
old_fn = @[key] | |
@[key] = => | |
console.log('wrapping call to ' + key) | |
old_fn.apply(@, arguments) | |
f: -> | |
console.log('calling f') | |
g: -> | |
console.log('calling g') | |
h: -> | |
console.log('calling h') | |
w = new WrapFunc() | |
w.f() | |
w.h() | |
w.g() | |
w.f() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment