Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
496 bytes
|
Line | |
---|
1 | dojo.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.