From 0d0926cbf56ba0ffa25e8cbc1a0e6a4c8334f0a8 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 3 Sep 2012 22:14:08 +0200 Subject: [PATCH] In Ox.cache (which is now called onload in Array.js to cache getSortValue), remove dependency on Ox.extend (which would depend on Ox.forEach) --- source/Ox/js/Function.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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