summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/lang/aspect
diff options
context:
space:
mode:
Diffstat (limited to 'js/dojo-1.6/dojox/lang/aspect')
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/cflow.js54
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/cflow.xd.js58
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/counter.js38
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/counter.xd.js42
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/memoizer.js56
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/memoizer.xd.js60
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/memoizerGuard.js44
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/memoizerGuard.xd.js48
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/profiler.js44
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/profiler.xd.js48
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/timer.js44
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/timer.xd.js48
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/tracer.js55
-rw-r--r--js/dojo-1.6/dojox/lang/aspect/tracer.xd.js59
14 files changed, 698 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/lang/aspect/cflow.js b/js/dojo-1.6/dojox/lang/aspect/cflow.js
new file mode 100644
index 0000000..cfbf905
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/cflow.js
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.cflow"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.cflow"] = true;
+dojo.provide("dojox.lang.aspect.cflow");
+
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ aop.cflow = function(/*Object*/ instance, /*String|RegExp|Array?*/ method){
+ // summary:
+ // Returns true if the context stack contains a context for a given
+ // instance that satisfies a given method name criteria.
+ //
+ // instance:
+ // An instance to be matched. If null, any context will be examined.
+ // Otherwise the context should belong to this instance.
+ //
+ // method:
+ // An optional pattern to be matched against a method name. Can be a string,
+ // a RegExp object or an array of strings and RegExp objects.
+ // If it is omitted, any name will satisfy the criteria.
+
+ if(arguments.length > 1 && !(method instanceof Array)){
+ method = [method];
+ }
+
+ var contextStack = aop.getContextStack();
+ for(var i = contextStack.length - 1; i >= 0; --i){
+ var c = contextStack[i];
+ // check if instance matches
+ if(instance && c.instance != instance){ continue; }
+ if(!method){ return true; }
+ var n = c.joinPoint.targetName;
+ for(var j = method.length - 1; j >= 0; --j){
+ var m = method[j];
+ if(m instanceof RegExp){
+ if(m.test(n)){ return true; }
+ }else{
+ if(n == m){ return true; }
+ }
+ }
+ }
+ return false; // Boolean
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/cflow.xd.js b/js/dojo-1.6/dojox/lang/aspect/cflow.xd.js
new file mode 100644
index 0000000..fa88da4
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/cflow.xd.js
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.cflow"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.cflow"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.cflow"] = true;
+dojo.provide("dojox.lang.aspect.cflow");
+
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ aop.cflow = function(/*Object*/ instance, /*String|RegExp|Array?*/ method){
+ // summary:
+ // Returns true if the context stack contains a context for a given
+ // instance that satisfies a given method name criteria.
+ //
+ // instance:
+ // An instance to be matched. If null, any context will be examined.
+ // Otherwise the context should belong to this instance.
+ //
+ // method:
+ // An optional pattern to be matched against a method name. Can be a string,
+ // a RegExp object or an array of strings and RegExp objects.
+ // If it is omitted, any name will satisfy the criteria.
+
+ if(arguments.length > 1 && !(method instanceof Array)){
+ method = [method];
+ }
+
+ var contextStack = aop.getContextStack();
+ for(var i = contextStack.length - 1; i >= 0; --i){
+ var c = contextStack[i];
+ // check if instance matches
+ if(instance && c.instance != instance){ continue; }
+ if(!method){ return true; }
+ var n = c.joinPoint.targetName;
+ for(var j = method.length - 1; j >= 0; --j){
+ var m = method[j];
+ if(m instanceof RegExp){
+ if(m.test(n)){ return true; }
+ }else{
+ if(n == m){ return true; }
+ }
+ }
+ }
+ return false; // Boolean
+ };
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/lang/aspect/counter.js b/js/dojo-1.6/dojox/lang/aspect/counter.js
new file mode 100644
index 0000000..8870a79
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/counter.js
@@ -0,0 +1,38 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.counter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.counter"] = true;
+dojo.provide("dojox.lang.aspect.counter");
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ var Counter = function(){
+ this.reset();
+ };
+ dojo.extend(Counter, {
+ before: function(/*arguments*/){
+ ++this.calls;
+ },
+ afterThrowing: function(/*excp*/){
+ ++this.errors;
+ },
+ reset: function(){
+ this.calls = this.errors = 0;
+ }
+ });
+
+ aop.counter = function(){
+ // summary:
+ // Returns an object, which can be used to count calls to methods.
+
+ return new Counter; // Object
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/counter.xd.js b/js/dojo-1.6/dojox/lang/aspect/counter.xd.js
new file mode 100644
index 0000000..52fc8ba
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/counter.xd.js
@@ -0,0 +1,42 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.counter"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.counter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.counter"] = true;
+dojo.provide("dojox.lang.aspect.counter");
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ var Counter = function(){
+ this.reset();
+ };
+ dojo.extend(Counter, {
+ before: function(/*arguments*/){
+ ++this.calls;
+ },
+ afterThrowing: function(/*excp*/){
+ ++this.errors;
+ },
+ reset: function(){
+ this.calls = this.errors = 0;
+ }
+ });
+
+ aop.counter = function(){
+ // summary:
+ // Returns an object, which can be used to count calls to methods.
+
+ return new Counter; // Object
+ };
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/lang/aspect/memoizer.js b/js/dojo-1.6/dojox/lang/aspect/memoizer.js
new file mode 100644
index 0000000..8068bb4
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/memoizer.js
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.memoizer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.memoizer"] = true;
+dojo.provide("dojox.lang.aspect.memoizer");
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ var memoize1 = {
+ around: function(key){
+ var ctx = aop.getContext(), self = ctx.joinPoint, that = ctx.instance, t, u, ret;
+ if((t = that.__memoizerCache) && (t = t[self.targetName]) && (key in t)){
+ return t[key];
+ }
+ var ret = aop.proceed.apply(null, arguments);
+ if(!(t = that.__memoizerCache)){ t = that.__memoizerCache = {}; }
+ if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; }
+ return u[key] = ret;
+ }
+ };
+
+ var memoizeN = function(/*Function*/keyMaker){
+ return {
+ around: function(/*arguments*/){
+ var ctx = aop.getContext(), self = ctx.joinPoint, that = ctx.instance, t, u, ret,
+ key = keyMaker.apply(that, arguments);
+ if((t = that.__memoizerCache) && (t = t[self.targetName]) && (key in t)){
+ return t[key];
+ }
+ var ret = aop.proceed.apply(null, arguments);
+ if(!(t = that.__memoizerCache)){ t = that.__memoizerCache = {}; }
+ if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; }
+ return u[key] = ret;
+ }
+ };
+ };
+
+ aop.memoizer = function(/*Function?*/ keyMaker){
+ // summary:
+ // Returns an object, which can be used to count calls to methods.
+ //
+ // keyMaker:
+ // the function, which takes method's arguments and returns a key,
+ // which can be used to index the result.
+
+ return arguments.length == 0 ? memoize1 : memoizeN(keyMaker); // Object
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/memoizer.xd.js b/js/dojo-1.6/dojox/lang/aspect/memoizer.xd.js
new file mode 100644
index 0000000..49bb274
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/memoizer.xd.js
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.memoizer"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.memoizer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.memoizer"] = true;
+dojo.provide("dojox.lang.aspect.memoizer");
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ var memoize1 = {
+ around: function(key){
+ var ctx = aop.getContext(), self = ctx.joinPoint, that = ctx.instance, t, u, ret;
+ if((t = that.__memoizerCache) && (t = t[self.targetName]) && (key in t)){
+ return t[key];
+ }
+ var ret = aop.proceed.apply(null, arguments);
+ if(!(t = that.__memoizerCache)){ t = that.__memoizerCache = {}; }
+ if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; }
+ return u[key] = ret;
+ }
+ };
+
+ var memoizeN = function(/*Function*/keyMaker){
+ return {
+ around: function(/*arguments*/){
+ var ctx = aop.getContext(), self = ctx.joinPoint, that = ctx.instance, t, u, ret,
+ key = keyMaker.apply(that, arguments);
+ if((t = that.__memoizerCache) && (t = t[self.targetName]) && (key in t)){
+ return t[key];
+ }
+ var ret = aop.proceed.apply(null, arguments);
+ if(!(t = that.__memoizerCache)){ t = that.__memoizerCache = {}; }
+ if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; }
+ return u[key] = ret;
+ }
+ };
+ };
+
+ aop.memoizer = function(/*Function?*/ keyMaker){
+ // summary:
+ // Returns an object, which can be used to count calls to methods.
+ //
+ // keyMaker:
+ // the function, which takes method's arguments and returns a key,
+ // which can be used to index the result.
+
+ return arguments.length == 0 ? memoize1 : memoizeN(keyMaker); // Object
+ };
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/lang/aspect/memoizerGuard.js b/js/dojo-1.6/dojox/lang/aspect/memoizerGuard.js
new file mode 100644
index 0000000..b8f39c6
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/memoizerGuard.js
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.memoizerGuard"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.memoizerGuard"] = true;
+dojo.provide("dojox.lang.aspect.memoizerGuard");
+
+(function(){
+ var aop = dojox.lang.aspect,
+ reset = function(/*String|Array?*/ method){
+ var that = aop.getContext().instance, t;
+ if(!(t = that.__memoizerCache)){ return; }
+ if(arguments.length == 0){
+ delete that.__memoizerCache;
+ }else if(dojo.isArray(method)){
+ dojo.forEach(method, function(m){ delete t[m]; });
+ }else{
+ delete t[method];
+ }
+ };
+
+
+ aop.memoizerGuard = function(/*String|Array?*/ method){
+ // summary:
+ // Invalidates the memoizer's cache (see dojox.lang.aspect.memoizer)
+ // after calling certain methods.
+ //
+ // method:
+ // Optional method's name to be guarded: only cache for
+ // this method will be invalidated on call. Can be a string
+ // or an array of method names. If omitted the whole cache
+ // will be invalidated.
+
+ return { // Object
+ after: function(){ reset(method); }
+ };
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/memoizerGuard.xd.js b/js/dojo-1.6/dojox/lang/aspect/memoizerGuard.xd.js
new file mode 100644
index 0000000..c4073ab
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/memoizerGuard.xd.js
@@ -0,0 +1,48 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.memoizerGuard"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.memoizerGuard"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.memoizerGuard"] = true;
+dojo.provide("dojox.lang.aspect.memoizerGuard");
+
+(function(){
+ var aop = dojox.lang.aspect,
+ reset = function(/*String|Array?*/ method){
+ var that = aop.getContext().instance, t;
+ if(!(t = that.__memoizerCache)){ return; }
+ if(arguments.length == 0){
+ delete that.__memoizerCache;
+ }else if(dojo.isArray(method)){
+ dojo.forEach(method, function(m){ delete t[m]; });
+ }else{
+ delete t[method];
+ }
+ };
+
+
+ aop.memoizerGuard = function(/*String|Array?*/ method){
+ // summary:
+ // Invalidates the memoizer's cache (see dojox.lang.aspect.memoizer)
+ // after calling certain methods.
+ //
+ // method:
+ // Optional method's name to be guarded: only cache for
+ // this method will be invalidated on call. Can be a string
+ // or an array of method names. If omitted the whole cache
+ // will be invalidated.
+
+ return { // Object
+ after: function(){ reset(method); }
+ };
+ };
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/lang/aspect/profiler.js b/js/dojo-1.6/dojox/lang/aspect/profiler.js
new file mode 100644
index 0000000..f6eeb0b
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/profiler.js
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.profiler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.profiler"] = true;
+dojo.provide("dojox.lang.aspect.profiler");
+
+(function(){
+ var aop = dojox.lang.aspect,
+ uniqueNumber = 0;
+
+ var Profiler = function(title){
+ this.args = title ? [title] : [];
+ this.inCall = 0;
+ };
+ dojo.extend(Profiler, {
+ before: function(/*arguments*/){
+ if(!(this.inCall++)){
+ console.profile.apply(console, this.args);
+ }
+ },
+ after: function(/*excp*/){
+ if(!--this.inCall){
+ console.profileEnd();
+ }
+ }
+ });
+
+ aop.profiler = function(/*String?*/ title){
+ // summary:
+ // Returns an object, which can be used to time calls to methods.
+ //
+ // title:
+ // The optional name of the profile section.
+
+ return new Profiler(title); // Object
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/profiler.xd.js b/js/dojo-1.6/dojox/lang/aspect/profiler.xd.js
new file mode 100644
index 0000000..1c4f144
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/profiler.xd.js
@@ -0,0 +1,48 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.profiler"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.profiler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.profiler"] = true;
+dojo.provide("dojox.lang.aspect.profiler");
+
+(function(){
+ var aop = dojox.lang.aspect,
+ uniqueNumber = 0;
+
+ var Profiler = function(title){
+ this.args = title ? [title] : [];
+ this.inCall = 0;
+ };
+ dojo.extend(Profiler, {
+ before: function(/*arguments*/){
+ if(!(this.inCall++)){
+ console.profile.apply(console, this.args);
+ }
+ },
+ after: function(/*excp*/){
+ if(!--this.inCall){
+ console.profileEnd();
+ }
+ }
+ });
+
+ aop.profiler = function(/*String?*/ title){
+ // summary:
+ // Returns an object, which can be used to time calls to methods.
+ //
+ // title:
+ // The optional name of the profile section.
+
+ return new Profiler(title); // Object
+ };
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/lang/aspect/timer.js b/js/dojo-1.6/dojox/lang/aspect/timer.js
new file mode 100644
index 0000000..606fc63
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/timer.js
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.timer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.timer"] = true;
+dojo.provide("dojox.lang.aspect.timer");
+
+(function(){
+ var aop = dojox.lang.aspect,
+ uniqueNumber = 0;
+
+ var Timer = function(name){
+ this.name = name || ("DojoAopTimer #" + ++uniqueNumber);
+ this.inCall = 0;
+ };
+ dojo.extend(Timer, {
+ before: function(/*arguments*/){
+ if(!(this.inCall++)){
+ console.time(this.name);
+ }
+ },
+ after: function(/*excp*/){
+ if(!--this.inCall){
+ console.timeEnd(this.name);
+ }
+ }
+ });
+
+ aop.timer = function(/*String?*/ name){
+ // summary:
+ // Returns an object, which can be used to time calls to methods.
+ //
+ // name:
+ // The optional unique name of the timer.
+
+ return new Timer(name); // Object
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/timer.xd.js b/js/dojo-1.6/dojox/lang/aspect/timer.xd.js
new file mode 100644
index 0000000..80409cb
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/timer.xd.js
@@ -0,0 +1,48 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.timer"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.timer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.timer"] = true;
+dojo.provide("dojox.lang.aspect.timer");
+
+(function(){
+ var aop = dojox.lang.aspect,
+ uniqueNumber = 0;
+
+ var Timer = function(name){
+ this.name = name || ("DojoAopTimer #" + ++uniqueNumber);
+ this.inCall = 0;
+ };
+ dojo.extend(Timer, {
+ before: function(/*arguments*/){
+ if(!(this.inCall++)){
+ console.time(this.name);
+ }
+ },
+ after: function(/*excp*/){
+ if(!--this.inCall){
+ console.timeEnd(this.name);
+ }
+ }
+ });
+
+ aop.timer = function(/*String?*/ name){
+ // summary:
+ // Returns an object, which can be used to time calls to methods.
+ //
+ // name:
+ // The optional unique name of the timer.
+
+ return new Timer(name); // Object
+ };
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/lang/aspect/tracer.js b/js/dojo-1.6/dojox/lang/aspect/tracer.js
new file mode 100644
index 0000000..1591dbc
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/tracer.js
@@ -0,0 +1,55 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.lang.aspect.tracer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.tracer"] = true;
+dojo.provide("dojox.lang.aspect.tracer");
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ var Tracer = function(/*Boolean*/ grouping){
+ this.method = grouping ? "group" : "log";
+ if(grouping){
+ this.after = this._after;
+ }
+ };
+ dojo.extend(Tracer, {
+ before: function(/*arguments*/){
+ var context = aop.getContext(), joinPoint = context.joinPoint,
+ args = Array.prototype.join.call(arguments, ", ");
+ console[this.method](context.instance, "=>", joinPoint.targetName + "(" + args + ")");
+ },
+ afterReturning: function(retVal){
+ var joinPoint = aop.getContext().joinPoint;
+ if(typeof retVal != "undefined"){
+ console.log(joinPoint.targetName + "() returns:", retVal);
+ }else{
+ console.log(joinPoint.targetName + "() returns");
+ }
+ },
+ afterThrowing: function(excp){
+ console.log(aop.getContext().joinPoint.targetName + "() throws:", excp);
+ },
+ _after: function(excp){
+ console.groupEnd();
+ }
+ });
+
+ aop.tracer = function(/*Boolean*/ grouping){
+ // summary:
+ // Returns an object, which can be used to trace calls with Firebug's console.
+ // Prints argument, a return value, or an exception.
+ //
+ // grouping:
+ // The flag to group output. If true, indents embedded console messages.
+
+ return new Tracer(grouping); // Object
+ };
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/lang/aspect/tracer.xd.js b/js/dojo-1.6/dojox/lang/aspect/tracer.xd.js
new file mode 100644
index 0000000..abd3e02
--- /dev/null
+++ b/js/dojo-1.6/dojox/lang/aspect/tracer.xd.js
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.lang.aspect.tracer"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.lang.aspect.tracer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.lang.aspect.tracer"] = true;
+dojo.provide("dojox.lang.aspect.tracer");
+
+(function(){
+ var aop = dojox.lang.aspect;
+
+ var Tracer = function(/*Boolean*/ grouping){
+ this.method = grouping ? "group" : "log";
+ if(grouping){
+ this.after = this._after;
+ }
+ };
+ dojo.extend(Tracer, {
+ before: function(/*arguments*/){
+ var context = aop.getContext(), joinPoint = context.joinPoint,
+ args = Array.prototype.join.call(arguments, ", ");
+ console[this.method](context.instance, "=>", joinPoint.targetName + "(" + args + ")");
+ },
+ afterReturning: function(retVal){
+ var joinPoint = aop.getContext().joinPoint;
+ if(typeof retVal != "undefined"){
+ console.log(joinPoint.targetName + "() returns:", retVal);
+ }else{
+ console.log(joinPoint.targetName + "() returns");
+ }
+ },
+ afterThrowing: function(excp){
+ console.log(aop.getContext().joinPoint.targetName + "() throws:", excp);
+ },
+ _after: function(excp){
+ console.groupEnd();
+ }
+ });
+
+ aop.tracer = function(/*Boolean*/ grouping){
+ // summary:
+ // Returns an object, which can be used to trace calls with Firebug's console.
+ // Prints argument, a return value, or an exception.
+ //
+ // grouping:
+ // The flag to group output. If true, indents embedded console messages.
+
+ return new Tracer(grouping); // Object
+ };
+})();
+
+}
+
+}};});