-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: clean up dead code and unused properties #1572
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,6 @@ function IncomingMessage(socket) { | |
|
||
this.readable = true; | ||
|
||
this._pendings = []; | ||
this._pendingIndex = 0; | ||
this.upgrade = null; | ||
|
||
// request (server) only | ||
|
@@ -49,7 +47,7 @@ function IncomingMessage(socket) { | |
// response (client) only | ||
this.statusCode = null; | ||
this.statusMessage = null; | ||
this.client = this.socket; | ||
this._client = socket; // deprecated | ||
|
||
// flag for backwards compatibility grossness. | ||
this._consuming = false; | ||
|
@@ -63,6 +61,16 @@ util.inherits(IncomingMessage, Stream.Readable); | |
|
||
exports.IncomingMessage = IncomingMessage; | ||
|
||
Object.defineProperty(IncomingMessage.prototype, 'client', { | ||
configurable: true, | ||
enumerable: true, | ||
get: util.deprecate(function() { | ||
return this._client; | ||
}, 'client is deprecated, use socket or connection instead'), | ||
set: util.deprecate(function(val) { | ||
this._client = val; | ||
}, 'client is deprecated, use socket or connection instead') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, just saw this. We should use set to change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (As written this changes behavior – previously setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, so it should initially be set to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, if the setter is changing |
||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might still want to support set here also if this is not semver-major There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would the setter do? Throw a deprecation error? Set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course, this will break if anyone is trying to do |
||
|
||
IncomingMessage.prototype.setTimeout = function(msecs, callback) { | ||
if (callback) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather we deprecate this property than delete it outright.