From 1e03da6b42b2948f2d27327c0d5083de3710d34e Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 24 Apr 2017 02:20:55 -0400 Subject: [PATCH] cluster: fix permanent deoptimizations PR-URL: https://github.com/nodejs/node/pull/12456 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- lib/internal/cluster/child.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index 3275eec720c738..98c5e7b5597f74 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -99,7 +99,7 @@ function shared(message, handle, indexesKey, cb) { delete handles[key]; delete indexes[indexesKey]; return close.apply(this, arguments); - }; + }.bind(handle); assert(handles[key] === undefined); handles[key] = handle; cb(message.errno, handle); @@ -192,7 +192,7 @@ function _disconnect(masterInitiated) { } } - for (const key in handles) { + for (var key in handles) { const handle = handles[key]; delete handles[key]; waitingCount++;