counter.js 593 B

12345678
  1. /*
  2. Copyright (c) 2004-2009, 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. if(!dojo._hasResource["dojox.lang.aspect.counter"]){dojo._hasResource["dojox.lang.aspect.counter"]=true;dojo.provide("dojox.lang.aspect.counter");(function(){var _1=dojox.lang.aspect;var _2=function(){this.reset();};dojo.extend(_2,{before:function(){++this.calls;},afterThrowing:function(){++this.errors;},reset:function(){this.calls=this.errors=0;}});_1.counter=function(){return new _2;};})();}