| 1 |
dojo.provide("dojox.lang.aspect.memoizerGuard"); |
| 2 |
|
| 3 |
(function(){ |
| 4 |
var aop = dojox.lang.aspect, |
| 5 |
reset = function( 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 |
|
| 17 |
|
| 18 |
aop.memoizerGuard = function( method){ |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
return { |
| 30 |
after: function(){ reset(method); } |
| 31 |
}; |
| 32 |
}; |
| 33 |
})(); |