diff --git a/lib/child_process.js b/lib/child_process.js index c8198cfa44..1ac2b9169f 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -668,6 +668,10 @@ function maybeClose(subprocess) { function ChildProcess() { EventEmitter.call(this); + // Initialize TCPWrap and PipeWrap + process.binding('tcp_wrap'); + process.binding('pipe_wrap'); + var self = this; this._closesNeeded = 1; diff --git a/lib/net.js b/lib/net.js index ad20e70f6d..0b1a81d321 100644 --- a/lib/net.js +++ b/lib/net.js @@ -142,10 +142,6 @@ function Socket(options) { stream.Duplex.call(this, options); if (options.handle) { - // Initialize TCPWrap and PipeWrap - process.binding('tcp_wrap'); - process.binding('pipe_wrap'); - this._handle = options.handle; // private } else if (typeof options.fd !== 'undefined') { this._handle = createPipe();