From 3bc6cfac4363bb27687687b439f1ab4918b131ee 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 --- 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 6a870a33697a1f..8a95d7df4afaa8 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -151,7 +151,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;