net: Initialize _connection, _handle in Socket ctor
authorisaacs <i@izs.me>
Mon, 28 Jan 2013 16:54:27 +0000 (08:54 -0800)
committerisaacs <i@izs.me>
Mon, 28 Jan 2013 17:09:34 +0000 (09:09 -0800)
The better to reduce the hidden classes

lib/net.js

index 966e4ce..ad20e70 100644 (file)
@@ -127,6 +127,9 @@ function initSocketHandle(self) {
 function Socket(options) {
   if (!(this instanceof Socket)) return new Socket(options);
 
+  this._connecting = false;
+  this._handle = null;
+
   switch (typeof options) {
     case 'number':
       options = { fd: options }; // Legacy interface.