Browse Source

net: Initialize _connection, _handle in Socket ctor

The better to reduce the hidden classes
v0.9.9-release
isaacs 12 years ago
parent
commit
4c78a52a3a
  1. 3
      lib/net.js

3
lib/net.js

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

Loading…
Cancel
Save