Ox.cache: don't use Ox.extend before it's available

This commit is contained in:
rolux 2013-12-01 13:24:37 +01:00
parent adea34c84e
commit acbc0f4e59

View file

@ -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() {