Ox.cache: don't use Ox.extend before it's available
This commit is contained in:
parent
adea34c84e
commit
acbc0f4e59
1 changed files with 3 additions and 4 deletions
|
@ -17,10 +17,9 @@ Ox.cache <f> Memoize a function
|
|||
// TODO: add async test
|
||||
Ox.cache = function(fn, options) {
|
||||
var cache = {}, ret;
|
||||
options = Ox.extend({
|
||||
async: false,
|
||||
key: JSON.stringify
|
||||
}, options || {});
|
||||
options = options || {};
|
||||
options.async = options.async || false;
|
||||
options.key = options.key || JSON.stringify;
|
||||
ret = function() {
|
||||
var args = Ox.slice(arguments), key = options.key(args);
|
||||
function callback() {
|
||||
|
|
Loading…
Reference in a new issue