mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Replace a bunch of Array.prototype.forEach()
cases with for...of
loops instead
Using `for...of` is a modern and generally much nicer pattern, since it gets rid of unnecessary callback-functions. (In a couple of spots, a "regular" `for` loop had to be used.)
This commit is contained in:
parent
da0e7ea969
commit
da22146b95
14 changed files with 67 additions and 71 deletions
|
@ -785,10 +785,10 @@ class WorkerMessageHandler {
|
|||
cancelXHRs(new AbortException("Worker was terminated."));
|
||||
}
|
||||
|
||||
WorkerTasks.forEach(function (task) {
|
||||
for (const task of WorkerTasks) {
|
||||
waitOn.push(task.finished);
|
||||
task.terminate();
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.all(waitOn).then(function () {
|
||||
// Notice that even if we destroying handler, resolved response promise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue