Changeset 13712
- Timestamp:
- 05/13/08 00:54:26 (6 months ago)
- Location:
- dojox/trunk/lang
- Files:
-
- 4 modified
-
aspect/memoizer.js (modified) (4 diffs)
-
aspect/memoizerGuard.js (modified) (1 diff)
-
aspect/tracer.js (modified) (1 diff)
-
README (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojox/trunk/lang/aspect/memoizer.js
r13651 r13712 4 4 var aop = dojox.lang.aspect; 5 5 6 var reset = function(/*String|Array?*/ method){7 var that = aop.getContext().instance, t;8 if(!(t = that.__memoizerCache)){ return; }9 if(arguments.length == 0){10 delete that.__memoizerCache;11 }else if(dojo.isArray(method)){12 dojo.forEach(method, function(m){ delete t[m]; });13 }else{14 delete t[method];15 }16 };17 6 var memoize1 = { 18 7 around: function(key){ … … 25 14 if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; } 26 15 return u[key] = ret; 27 }, 28 reset: reset 16 } 29 17 }; 30 18 … … 41 29 if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; } 42 30 return u[key] = ret; 43 }, 44 reset: reset 31 } 45 32 }; 46 33 }; … … 56 43 return arguments.length == 0 ? memoize1 : memoizeN(keyMaker); // Object 57 44 }; 58 aop.memoizer._reset = reset;59 45 })(); -
dojox/trunk/lang/aspect/memoizerGuard.js
r13651 r13712 1 1 dojo.provide("dojox.lang.aspect.memoizerGuard"); 2 dojo.require("dojox.lang.aspect.memoizer");3 2 4 3 (function(){ 5 var aop = dojox.lang.aspect, reset = aop.memoizer._reset; 4 var aop = dojox.lang.aspect, 5 reset = function(/*String|Array?*/ method){ 6 var that = aop.getContext().instance, t; 7 if(!(t = that.__memoizerCache)){ return; } 8 if(arguments.length == 0){ 9 delete that.__memoizerCache; 10 }else if(dojo.isArray(method)){ 11 dojo.forEach(method, function(m){ delete t[m]; }); 12 }else{ 13 delete t[method]; 14 } 15 }; 16 6 17 7 18 aop.memoizerGuard = function(/*String|Array?*/ method){ 8 19 // summary: 9 // Invalidates cache (see dojox.lang.aspect.memoizer)20 // Invalidates the memoizer's cache (see dojox.lang.aspect.memoizer) 10 21 // after calling certain methods. 11 22 // -
dojox/trunk/lang/aspect/tracer.js
r13467 r13712 32 32 }); 33 33 34 aop.tracer = function(/*Boolean*/ grouping , /*Boolean*/ suppressInstance){34 aop.tracer = function(/*Boolean*/ grouping){ 35 35 // summary: 36 36 // Returns an object, which can be used to trace calls with Firebug's console. -
dojox/trunk/lang/README
r11628 r13712 13 13 Project description 14 14 15 Implementation of common functional operations, and provisions 16 Later we can add other JS language-related helpers.15 Implementation of common functional operations, and provisions, aspect-oriented 16 helpers. Later we can add other JS language-related helpers. 17 17 ------------------------------------------------------------------------------- 18 18 Dependencies: … … 22 22 Documentation 23 23 24 For now: 25 26 dojox.lang.functional: 27 http://lazutkin.com/blog/2008/jan/12/functional-fun-javascript-dojo/ 28 24 29 ------------------------------------------------------------------------------- 25 30 Installation instructions 26 31 27 32 Grab the following from the Dojo SVN Repository: 28 http://svn.dojotoolkit.org/ var/src/dojo/dojox/trunk/lang/*33 http://svn.dojotoolkit.org/src/dojo/dojox/trunk/lang/* 29 34 30 35 Install into the following directory structure: … … 36 41 37 42 See tests and the source for more details. 43 44 LICENSE in this directory contains the MIT license by Oliver Steele for 45 dojox.lang.functional.lambda, which was derived from his original implementation.