Skip to content

Instantly share code, notes, and snippets.

@zholmquist
Created October 26, 2010 22:08
Show Gist options
  • Save zholmquist/647935 to your computer and use it in GitHub Desktop.
Save zholmquist/647935 to your computer and use it in GitHub Desktop.
<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