source: Dev/trunk/src/client/dojox/lang/aspect/counter.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 496 bytes
Line 
1dojo.provide("dojox.lang.aspect.counter");
2
3(function(){
4        var aop = dojox.lang.aspect;
5       
6        var Counter = function(){
7                this.reset();
8        };
9        dojo.extend(Counter, {
10                before: function(/*arguments*/){
11                        ++this.calls;
12                },
13                afterThrowing: function(/*excp*/){
14                        ++this.errors;
15                },
16                reset: function(){
17                        this.calls = this.errors = 0;
18                }
19        });
20       
21        aop.counter = function(){
22                // summary:
23                //              Returns an object, which can be used to count calls to methods.
24       
25                return new Counter;     // Object
26        };
27})();
Note: See TracBrowser for help on using the repository browser.