From a04a5d8325ff967a26f4baae3413a3d061c3f29f Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 21 Jun 2020 11:29:05 +0200 Subject: [PATCH] Tweak the loop in `ChunkedStreamManager.abort` to clarify what's being iterated (PR 11985 follow-up) In hindsight, using the `for (let [key, value] of myMap) { ... }`-format when we don't care about the `key` probably wasn't such a great idea. Since `Map`s have explicit support for iterating either `key`s or `value`s, we should probably use that instead here. --- src/core/chunked_stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/chunked_stream.js b/src/core/chunked_stream.js index f041f8bc0..c764c7181 100644 --- a/src/core/chunked_stream.js +++ b/src/core/chunked_stream.js @@ -591,7 +591,7 @@ class ChunkedStreamManager { if (this.pdfNetworkStream) { this.pdfNetworkStream.cancelAllRequests(reason); } - for (const [, capability] of this._promisesByRequest) { + for (const capability of this._promisesByRequest.values()) { capability.reject(reason); } }