diff options
-rwxr-xr-x | test/test-async.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js index 05c0228..19c30c1 100755 --- a/test/test-async.js +++ b/test/test-async.js @@ -4309,6 +4309,32 @@ exports['memoize'] = { test.equal(val, "bar"); test.done(); }); +}, + + 'avoid constructor key return undefined': function (test) { + test.expect(1); + var fn = async.memoize(function(name, callback) { + async.setImmediate(function(){ + callback(null, name); + }); + }); + fn('constructor', function(error, results) { + test.equal(results, 'constructor'); + test.done(); + }); +}, + + 'avoid __proto__ key return undefined': function (test) { + test.expect(1); + var fn = async.memoize(function(name, callback) { + async.setImmediate(function(){ + callback(null, name); + }); + }); + fn('__proto__', function(error, results) { + test.equal(results, '__proto__'); + test.done(); + }); } }; |