Skip to content

Commit 3bc6cfa

Browse files
committed
http: explain the unused argument in IncomingMessage._read
1 parent 28bc61b commit 3bc6cfa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/_http_incoming.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
151151
return this;
152152
};
153153

154-
154+
// Argument n cannot be factored out due to the overhead of
155+
// argument adaptor frame creation inside V8 in case that number of actual
156+
// arguments is different from expected arguments.
157+
// Ref: https://bugs.chromium.org/p/v8/issues/detail?id=10201
155158
IncomingMessage.prototype._read = function _read(n) {
156159
if (!this._consuming) {
157160
this._readableState.readingMore = false;

0 commit comments

Comments
 (0)