Skip to content

Commit 4a6ac52

Browse files
committed
Test case for #998.
1 parent 709b861 commit 4a6ac52

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/test-async.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4309,6 +4309,32 @@ exports['memoize'] = {
43094309
test.equal(val, "bar");
43104310
test.done();
43114311
});
4312+
},
4313+
4314+
'avoid constructor key return undefined': function (test) {
4315+
test.expect(1);
4316+
var fn = async.memoize(function(name, callback) {
4317+
async.setImmediate(function(){
4318+
callback(null, name);
4319+
});
4320+
});
4321+
fn('constructor', function(error, results) {
4322+
test.equal(results, 'constructor');
4323+
test.done();
4324+
});
4325+
},
4326+
4327+
'avoid __proto__ key return undefined': function (test) {
4328+
test.expect(1);
4329+
var fn = async.memoize(function(name, callback) {
4330+
async.setImmediate(function(){
4331+
callback(null, name);
4332+
});
4333+
});
4334+
fn('__proto__', function(error, results) {
4335+
test.equal(results, '__proto__');
4336+
test.done();
4337+
});
43124338
}
43134339

43144340
};

0 commit comments

Comments
 (0)