Created
October 26, 2010 22:08
-
-
Save zholmquist/647935 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
<script> | |
Function.prototype.before = function(methodName, newFunc) { | |
var oldFunc = this[methodName]; | |
console.debug(oldFunc) | |
}; | |
function someObject() | |
{ | |
this.before = Function.prototype.before; | |
this.one_more = function() | |
{ | |
console.debug('one_more'); | |
} | |
} | |
var another_obj = new someObject(); | |
another_obj.before("one_more", function(){ | |
console.debug('then see this'); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment