Skip to content

Commit 709b861

Browse files
committed
prevent return "undefined" immediately when key is "constructor" for memoize method.
1 parent 11f5d1f commit 709b861

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/async.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,12 +1089,12 @@
10891089
var memoized = _restParam(function memoized(args) {
10901090
var callback = args.pop();
10911091
var key = hasher.apply(null, args);
1092-
if (key in memo) {
1092+
if (memo.hasOwnProperty(key)) {
10931093
async.setImmediate(function () {
10941094
callback.apply(null, memo[key]);
10951095
});
10961096
}
1097-
else if (key in queues) {
1097+
else if (queues.hasOwnProperty(key)) {
10981098
queues[key].push(callback);
10991099
}
11001100
else {

0 commit comments

Comments
 (0)