mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
net: Initialize _connection, _handle in Socket ctor
The better to reduce the hidden classes
This commit is contained in:
parent
faf78604ca
commit
4c78a52a3a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user