fix a bug that would throw an error when running tests for Ox.cache

This commit is contained in:
rlx 2012-03-29 12:34:13 +00:00
parent def7c88639
commit b807fc81af

View file

@ -2,11 +2,11 @@
/*@
Ox.cache <f> Memoize a function
<script>
var f = Ox.cache(function(n) { return n * Math.random(); });
Ox.test.fn = Ox.cache(function(n) { return n * Math.random(); });
</script>
> f(10) == f(10);
> Ox.test.fn(10) == Ox.test.fn(10);
true
> f(10) == f.clear()(10);
> Ox.test.fn(10) == Ox.test.fn.clear()(10);
false
@*/
Ox.cache = function(fn) {