From d63ac28a9a7b415f68899b7f6870ea47824ff3d9 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 e166177e0d4947..18121830b5048b 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -152,7 +152,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;