File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4309,6 +4309,32 @@ exports['memoize'] = {
4309
4309
test . equal ( val , "bar" ) ;
4310
4310
test . done ( ) ;
4311
4311
} ) ;
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
+ } ) ;
4312
4338
}
4313
4339
4314
4340
} ;
You can’t perform that action at this time.
0 commit comments