This commit changes `lib/dgram.js` Sockets to, when
they are bound to a port / IP, return themselves. This
is done in order to allow chaining of methods and be
in accordance with the `lib/net.js` library.
PR-URL: https://github.com/iojs/io.js/pull/214
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
if (port instanceof UDP) {
replaceHandle(self, port);
startListening(self);
- return;
+ return self;
}
var address;
startListening(self);
}
});
+
+ return self;
};
socket.close();
});
-socket.bind(); // should not throw
+var result = socket.bind(); // should not throw
+
+assert.strictEqual(result, socket); // should have returned itself