일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- jsr 296
- PHP
- PLSQL
- rowspan
- MFC
- oracle
- 전자정부프레임워크
- tomcat
- Android
- 가우스
- node.js
- swingx
- Ajax
- sencha touch
- Google Map
- Struts
- ibsheet
- 선택적조인
- iBATIS
- JDOM
- phonegap
- WebLogic
- Spring
- GPS
- jQuery
- MySQL
- JSON
- dock
- appspresso
- Eclipse
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);
}
};
}