Skip to content

Instantly share code, notes, and snippets.

@crossai-2033
Created August 17, 2013 05:04
Show Gist options
  • Save crossai-2033/6255366 to your computer and use it in GitHub Desktop.
Save crossai-2033/6255366 to your computer and use it in GitHub Desktop.
simple aop..
// 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