일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Eclipse
- Struts
- 선택적조인
- oracle
- Google Map
- Ajax
- phonegap
- JDOM
- jsr 296
- swingx
- Android
- appspresso
- 전자정부프레임워크
- sencha touch
- jQuery
- node.js
- MFC
- ibsheet
- PHP
- dock
- rowspan
- JSON
- 가우스
- iBATIS
- tomcat
- Spring
- WebLogic
- GPS
- MySQL
- PLSQL
Archives
- Today
- Total
Where The Streets Have No Name
actsAsAspect.js 본문
/*
* 출처 : http://beppu.lbox.org/articles/2006/09/06/actsasaspect
*/
functionactsAsAspect(object) {
object.yield = null;
object.rv = { };
object.before = function(method, f) {
var original = eval("this." + method);
this[method] = function() {
f.apply(this, arguments);
return original.apply(this, arguments);
};
};
object.after = function(method, f) {
var original = eval("this." + method);
this[method] = function() {
this.rv[method] = original.apply(this, arguments);
return f.apply(this, arguments);
}
};
object.around = function(method, f) {
var original = eval("this." + method);
this[method] = function() {
this.yield = original;
return f.apply(this, arguments);
}
};
}
* 출처 : http://beppu.lbox.org/articles/2006/09/06/actsasaspect
*/
functionactsAsAspect(object) {
object.yield = null;
object.rv = { };
object.before = function(method, f) {
var original = eval("this." + method);
this[method] = function() {
f.apply(this, arguments);
return original.apply(this, arguments);
};
};
object.after = function(method, f) {
var original = eval("this." + method);
this[method] = function() {
this.rv[method] = original.apply(this, arguments);
return f.apply(this, arguments);
}
};
object.around = function(method, f) {
var original = eval("this." + method);
this[method] = function() {
this.yield = original;
return f.apply(this, arguments);
}
};
}