From acbc0f4e592ba307c4615ec616803cebed7c43d7 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 1 Dec 2013 13:24:37 +0100 Subject: [PATCH] Ox.cache: don't use Ox.extend before it's available --- source/Ox/js/Function.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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() {