root / trunk / web / dojo / dojox / lang / aspect / tracer.js @ 12
History | View | Annotate | Download (869 Bytes)
| 1 |
/*
|
|---|---|
| 2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
| 3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
| 4 |
see: http://dojotoolkit.org/license for details
|
| 5 |
*/
|
| 6 |
|
| 7 |
|
| 8 |
if(!dojo._hasResource["dojox.lang.aspect.tracer"]){ |
| 9 |
dojo._hasResource["dojox.lang.aspect.tracer"]=true; |
| 10 |
dojo.provide("dojox.lang.aspect.tracer");
|
| 11 |
(function(){
|
| 12 |
var _1=dojox.lang.aspect;
|
| 13 |
var _2=function(_3){ |
| 14 |
this.method=_3?"group":"log"; |
| 15 |
if(_3){
|
| 16 |
this.after=this._after; |
| 17 |
} |
| 18 |
}; |
| 19 |
dojo.extend(_2,{before:function(){
|
| 20 |
var _4=_1.getContext(),_5=_4.joinPoint,_6=Array.prototype.join.call(arguments,", "); |
| 21 |
console[this.method](_4.instance,"=>",_5.targetName+"("+_6+")"); |
| 22 |
},afterReturning:function(_7){ |
| 23 |
var _8=_1.getContext().joinPoint;
|
| 24 |
if(typeof _7!="undefined"){ |
| 25 |
}else{
|
| 26 |
} |
| 27 |
},afterThrowing:function(_9){ |
| 28 |
},_after:function(_a){ |
| 29 |
}}); |
| 30 |
_1.tracer=function(_b){ |
| 31 |
return new _2(_b); |
| 32 |
}; |
| 33 |
})(); |
| 34 |
} |