File tree 2 files changed +6
-3
lines changed
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() {
508
508
// sent out to the other side.
509
509
Socket . prototype . _final = function ( cb ) {
510
510
// If still connecting - defer handling `_final` until 'connect' will happen
511
- if ( this . pending ) {
511
+ if ( this . connecting ) {
512
512
debug ( '_final: not yet connected' ) ;
513
513
return this . once ( 'connect' , ( ) => this . _final ( cb ) ) ;
514
514
}
Original file line number Diff line number Diff line change 20
20
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
22
22
'use strict' ;
23
- require ( '../common' ) ;
23
+ const common = require ( '../common' ) ;
24
24
const net = require ( 'net' ) ;
25
+ const assert = require ( 'assert' ) ;
25
26
26
27
const 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