Skip to content

Commit 9fa1f68

Browse files
Ayase-252dnlup
authored andcommitted
http: explain the unused argument in IncomingMessage._read
PR-URL: #37275 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent ad3ebed commit 9fa1f68

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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)