Created
August 17, 2013 05:04
-
-
Save crossai-2033/6255366 to your computer and use it in GitHub Desktop.
simple aop..
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
// AOP简易模型 | |
function Ting() {} | |
Thing.prototype.doSomething = function(x, y) { | |
var result; | |
return result; | |
}; | |
var thing = new Thing; | |
var origDoSomething = thing.doSomething; | |
thing.doSomething = function() { | |
doSomethingBefore(); | |
return origDoSomething.apply(this, arguments); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment