summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/internal/cluster/round_robin_handle.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/internal/cluster/round_robin_handle.js b/lib/internal/cluster/round_robin_handle.js
index 86c7bec738..5a12a61d49 100644
--- a/lib/internal/cluster/round_robin_handle.js
+++ b/lib/internal/cluster/round_robin_handle.js
@@ -79,8 +79,10 @@ RoundRobinHandle.prototype.remove = function(worker) {
if (this.all.size !== 0)
return false;
- for (var handle; handle = this.handles.shift(); handle.close())
- ;
+ for (const handle of this.handles) {
+ handle.close();
+ }
+ this.handles = [];
this.handle.close();
this.handle = null;