Changeset 13712

Show
Ignore:
Timestamp:
05/13/08 00:54:26 (6 months ago)
Author:
elazutkin
Message:

dojox.lang.aspect: cleanup. !strict

Location:
dojox/trunk/lang
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • dojox/trunk/lang/aspect/memoizer.js

    r13651 r13712  
    44        var aop = dojox.lang.aspect; 
    55 
    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         }; 
    176        var memoize1 = { 
    187                around: function(key){ 
     
    2514                        if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; } 
    2615                        return u[key] = ret; 
    27                 }, 
    28                 reset: reset 
     16                } 
    2917        }; 
    3018 
     
    4129                                if(!(u = t[self.targetName])){ u = t[self.targetName] = {}; } 
    4230                                return u[key] = ret; 
    43                         }, 
    44                         reset: reset 
     31                        } 
    4532                }; 
    4633        }; 
     
    5643                return arguments.length == 0 ? memoize1 : memoizeN(keyMaker);   // Object 
    5744        }; 
    58         aop.memoizer._reset = reset; 
    5945})(); 
  • dojox/trunk/lang/aspect/memoizerGuard.js

    r13651 r13712  
    11dojo.provide("dojox.lang.aspect.memoizerGuard"); 
    2 dojo.require("dojox.lang.aspect.memoizer"); 
    32 
    43(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 
    617 
    718        aop.memoizerGuard = function(/*String|Array?*/ method){ 
    819                // summary: 
    9                 //              Invalidates cache (see dojox.lang.aspect.memoizer) 
     20                //              Invalidates the memoizer's cache (see dojox.lang.aspect.memoizer) 
    1021                //              after calling certain methods. 
    1122                // 
  • dojox/trunk/lang/aspect/tracer.js

    r13467 r13712  
    3232        }); 
    3333         
    34         aop.tracer = function(/*Boolean*/ grouping, /*Boolean*/ suppressInstance){ 
     34        aop.tracer = function(/*Boolean*/ grouping){ 
    3535                // summary: 
    3636                //              Returns an object, which can be used to trace calls with Firebug's console. 
  • dojox/trunk/lang/README

    r11628 r13712  
    1313Project description 
    1414 
    15 Implementation of common functional operations, and provisions 
    16 Later we can add other JS language-related helpers. 
     15Implementation of common functional operations, and provisions, aspect-oriented 
     16helpers. Later we can add other JS language-related helpers. 
    1717------------------------------------------------------------------------------- 
    1818Dependencies: 
     
    2222Documentation 
    2323 
     24For now: 
     25 
     26dojox.lang.functional: 
     27http://lazutkin.com/blog/2008/jan/12/functional-fun-javascript-dojo/ 
     28 
    2429------------------------------------------------------------------------------- 
    2530Installation instructions 
    2631 
    2732Grab the following from the Dojo SVN Repository: 
    28 http://svn.dojotoolkit.org/var/src/dojo/dojox/trunk/lang/* 
     33http://svn.dojotoolkit.org/src/dojo/dojox/trunk/lang/* 
    2934 
    3035Install into the following directory structure: 
     
    3641 
    3742See tests and the source for more details. 
     43 
     44LICENSE in this directory contains the MIT license by Oliver Steele for 
     45dojox.lang.functional.lambda, which was derived from his original implementation.