Ox.cache: don't use Ox.extend before it's available
This commit is contained in:
parent
adea34c84e
commit
acbc0f4e59
1 changed files with 3 additions and 4 deletions
|
@ -17,10 +17,9 @@ Ox.cache <f> Memoize a function
|
||||||
// TODO: add async test
|
// TODO: add async test
|
||||||
Ox.cache = function(fn, options) {
|
Ox.cache = function(fn, options) {
|
||||||
var cache = {}, ret;
|
var cache = {}, ret;
|
||||||
options = Ox.extend({
|
options = options || {};
|
||||||
async: false,
|
options.async = options.async || false;
|
||||||
key: JSON.stringify
|
options.key = options.key || JSON.stringify;
|
||||||
}, options || {});
|
|
||||||
ret = function() {
|
ret = function() {
|
||||||
var args = Ox.slice(arguments), key = options.key(args);
|
var args = Ox.slice(arguments), key = options.key(args);
|
||||||
function callback() {
|
function callback() {
|
||||||
|
|
Loading…
Reference in a new issue