From 926bb4fd170ce0031f2f77d5fac8189676ccaf4a Mon Sep 17 00:00:00 2001 From: Qingyu Deng Date: Tue, 9 Feb 2021 06:28:42 +0800 Subject: [PATCH] http: explain the unused argument in IncomingMessage._read PR-URL: https://github.com/nodejs/node/pull/37275 Reviewed-By: Antoine du Hamel Reviewed-By: Darshan Sen Reviewed-By: Matteo Collina --- lib/_http_incoming.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index a33d75c3e79..7bf66fbddb8 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -100,7 +100,10 @@ IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { return this; }; - +// Argument n cannot be factored out due to the overhead of +// argument adaptor frame creation inside V8 in case that number of actual +// arguments is different from expected arguments. +// Ref: https://bugs.chromium.org/p/v8/issues/detail?id=10201 IncomingMessage.prototype._read = function _read(n) { if (!this._consuming) { this._readableState.readingMore = false;