mirror of
https://github.com/BreizhHardware/memoizee.git
synced 2026-01-18 16:37:21 +01:00
Fix arguments resolution in weak length=1 version
This commit is contained in:
@@ -36,10 +36,11 @@ module.exports = function (memoize) {
|
||||
!(options.dispose && extensions.dispose) && !(options.maxAge && extensions.maxAge) &&
|
||||
!(options.max && extensions.max) && !(options.refCounter && extensions.refCounter)) {
|
||||
return defineProperties(function (obj) {
|
||||
var result;
|
||||
if (resolve) obj = resolve(arguments)[0];
|
||||
var result, args = arguments;
|
||||
if (resolve) args = resolve(args);
|
||||
obj = args[0];
|
||||
if (map.has(obj)) return map.get(obj);
|
||||
result = fn.call(this, obj);
|
||||
result = fn.apply(this, args);
|
||||
if (map.has(obj)) throw customError("Circular invocation", 'CIRCULAR_INVOCATION');
|
||||
map.set(obj, result);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user