fix a bug that would throw an error when running tests for Ox.cache
This commit is contained in:
parent
def7c88639
commit
b807fc81af
1 changed files with 3 additions and 3 deletions
|
@ -2,11 +2,11 @@
|
||||||
/*@
|
/*@
|
||||||
Ox.cache <f> Memoize a function
|
Ox.cache <f> Memoize a function
|
||||||
<script>
|
<script>
|
||||||
var f = Ox.cache(function(n) { return n * Math.random(); });
|
Ox.test.fn = Ox.cache(function(n) { return n * Math.random(); });
|
||||||
</script>
|
</script>
|
||||||
> f(10) == f(10);
|
> Ox.test.fn(10) == Ox.test.fn(10);
|
||||||
true
|
true
|
||||||
> f(10) == f.clear()(10);
|
> Ox.test.fn(10) == Ox.test.fn.clear()(10);
|
||||||
false
|
false
|
||||||
@*/
|
@*/
|
||||||
Ox.cache = function(fn) {
|
Ox.cache = function(fn) {
|
||||||
|
|
Loading…
Reference in a new issue