Skip to content

Commit

Permalink
prevent return "undefined" immediately when key is "constructor" for …
Browse files Browse the repository at this point in the history
…memoize method.
  • Loading branch information
dacoozheng committed Jan 3, 2016
1 parent 11f5d1f commit 709b861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -1089,12 +1089,12 @@
var memoized = _restParam(function memoized(args) {
var callback = args.pop();
var key = hasher.apply(null, args);
if (key in memo) {
if (memo.hasOwnProperty(key)) {
async.setImmediate(function () {
callback.apply(null, memo[key]);
});
}
else if (key in queues) {
else if (queues.hasOwnProperty(key)) {
queues[key].push(callback);
}
else {
Expand Down

0 comments on commit 709b861

Please sign in to comment.