net: deduplicate Socket.prototype.address

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Yazhong Liu 2014-04-14 01:19:14 +08:00 committed by Fedor Indutny
parent 2272052461
commit 940974ed03

View File

@ -340,13 +340,7 @@ Socket.prototype.setKeepAlive = function(setting, msecs) {
Socket.prototype.address = function() {
if (this._handle && this._handle.getsockname) {
var out = {};
var err = this._handle.getsockname(out);
// TODO(bnoordhuis) Check err and throw?
return out;
}
return null;
return this._getsockname();
};