Aspects = function(){};
Aspects.prototype={
before:function(method,advice){
var original = this[method];
this[method] = function(){
(advice)();
original.apply(this,arguments);
}
},
after:function(method,advice){
var original = this[method];
this[method] = function(){
original.apply(this,arguments);
var args = method;
advice.call(original,method);
}
},
around:function(method,advice){
var original = this[method];
this[method] = function(){
(advice)();
original.apply(this,arguments);
(advice)();
}
}
}