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