Created
January 3, 2011 21:21
-
-
Save canonic-epicure/763985 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
var NativeSuperizer = function () { | |
var method = arguments.callee.caller | |
this.meta.superizeMethod(method.name) | |
return this.SUPER.apply(this, arguments) | |
} | |
superizeMethod = function (name) { | |
var proto = this.c.prototype | |
var chain = [ NativeSuperizer ].concat( this.getInheritanceChainForMethod(name).reverse ) | |
var index = 0 | |
proto[ name ] = function () { | |
this.SUPER = chain[ i + 1 ] | |
var res = chain[ ++i ].apply(this, arguments) | |
this.SUPER = chain[ --i ] | |
return res | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment