Fix resolvers bug. Fixes #12

This commit is contained in:
Mariusz Nowak
2016-04-21 14:50:01 +02:00
parent f333e58640
commit 9f86b198f9
2 changed files with 5 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ module.exports = function (original, length, options) {
return cache[id];
}
}
if (args.length === 1) result = call.call(original, this, arg);
if (args.length === 1) result = call.call(original, this, args[0]);
else result = apply.call(original, this, args);
if (id === null) {
id = get(args);

View File

@@ -54,6 +54,10 @@ module.exports = function () {
a(fn(), r, "Third");
a(i, 1, "Called once");
},
"One arg": function (a) {
var fn = memoize(function (elo) { ++i; return arguments; }, { resolvers: [Boolean] });
a.deep(aFrom(r = fn('elo')), [true], "First");
},
"Some Args": function (a) {
var x = {};
i = 0;