Skip to content

Commit

Permalink
Remove deprecation warnings in net module
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 16, 2010
1 parent a63fd0f commit 251d031
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
20 changes: 0 additions & 20 deletions lib/net.js
Expand Up @@ -936,17 +936,6 @@ Stream.prototype.resume = function () {
};


var forceCloseWarning;

Stream.prototype.forceClose = function (e) {
if (!forceCloseWarning) {
forceCloseWarning = "forceClose() has been renamed to destroy()";
sys.error(forceCloseWarning);
}
return this.destroy(e);
};


Stream.prototype.destroy = function (exception) {
// pool is shared between sockets, so don't need to free it here.
var self = this;
Expand Down Expand Up @@ -1011,15 +1000,6 @@ Stream.prototype._shutdown = function () {
}
};

var closeDepricationWarning;

Stream.prototype.close = function (data, encoding) {
if (!closeDepricationWarning) {
closeDepricationWarning = "Notification: Stream.prototype.close has been renamed to end()";
sys.error(closeDepricationWarning);
}
return this.end(data, encoding);
};

Stream.prototype.end = function (data, encoding) {
if (this.writable) {
Expand Down
4 changes: 2 additions & 2 deletions test/simple/test-http-eof-on-connect.js
Expand Up @@ -12,8 +12,8 @@ server.listen(common.PORT);

server.addListener("listening", function() {
net.createConnection(common.PORT).addListener("connect", function () {
this.close();
this.destroy();
}).addListener("close", function () {
server.close();
});
});
});

0 comments on commit 251d031

Please sign in to comment.