diff --git a/source/Ox/js/Function.js b/source/Ox/js/Function.js index 782b4e17..f1b2c4c3 100644 --- a/source/Ox/js/Function.js +++ b/source/Ox/js/Function.js @@ -12,12 +12,12 @@ Ox.cache Memoize a function @*/ // TODO: add async test Ox.cache = function(fn, options) { - options = Ox.extend({ - async: false, - key: JSON.stringify - }, options || {}) var cache = {}, ret = function() { + options = Ox.extend({ + async: false, + key: JSON.stringify + }, options || {}); var args = Ox.toArray(arguments), key = options.key(args); function callback() { // cache all arguments passed to callback