File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -508,7 +508,7 @@ Socket.prototype._unrefTimer = function _unrefTimer() {
508508// sent out to the other side. 
509509Socket . prototype . _final  =  function ( cb )  { 
510510  // If still connecting - defer handling `_final` until 'connect' will happen 
511-   if  ( this . pending )  { 
511+   if  ( this . connecting )  { 
512512    debug ( '_final: not yet connected' ) ; 
513513    return  this . once ( 'connect' ,  ( )  =>  this . _final ( cb ) ) ; 
514514  } 
Original file line number Diff line number Diff line change 2020// USE OR OTHER DEALINGS IN THE SOFTWARE. 
2121
2222'use strict' ; 
23- require ( '../common' ) ; 
23+ const   common   =   require ( '../common' ) ; 
2424const  net  =  require ( 'net' ) ; 
25+ const  assert  =  require ( 'assert' ) ; 
2526
2627const  sock  =  new  net . Socket ( ) ; 
27- sock . end ( ) ;   // Should not throw. 
28+ sock . end ( common . mustCall ( ( )  =>  { 
29+   assert . strictEqual ( sock . writable ,  false ) ; 
30+ } ) ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments