diff --git a/source/Ox/js/Function.js b/source/Ox/js/Function.js index d023f0ea..93f98821 100644 --- a/source/Ox/js/Function.js +++ b/source/Ox/js/Function.js @@ -17,10 +17,9 @@ Ox.cache 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() {