summaryrefslogtreecommitdiff
path: root/lib/internal/cluster
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-07-27 14:35:39 +0200
committerAnna Henningsen <anna@addaleax.net>2018-08-05 13:46:13 +0200
commitaf7164ebccd21d9fc5b0782e0427257f7637a4db (patch)
tree589f506811cb65293b88fcd8984ae7ac0e5a80be /lib/internal/cluster
parenta196aa2e24ef7069289fa4a9aa8c6862d82e6b5f (diff)
downloadandroid-node-v8-af7164ebccd21d9fc5b0782e0427257f7637a4db.tar.gz
android-node-v8-af7164ebccd21d9fc5b0782e0427257f7637a4db.tar.bz2
android-node-v8-af7164ebccd21d9fc5b0782e0427257f7637a4db.zip
lib,src: standardize `owner_symbol` for handles
Instead of somtimes using an `owner` string to link from a native handle object to the corresponding JS object, standardize on a single symbol that fulfills this role. PR-URL: https://github.com/nodejs/node/pull/22002 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'lib/internal/cluster')
-rw-r--r--lib/internal/cluster/child.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js
index 40c1a12327..39e891214f 100644
--- a/lib/internal/cluster/child.js
+++ b/lib/internal/cluster/child.js
@@ -3,6 +3,7 @@ const assert = require('assert');
const util = require('util');
const path = require('path');
const EventEmitter = require('events');
+const { owner_symbol } = require('internal/async_hooks').symbols;
const Worker = require('internal/cluster/worker');
const { internal, sendHelper } = require('internal/cluster/utils');
const cluster = new EventEmitter();
@@ -207,8 +208,8 @@ function _disconnect(masterInitiated) {
delete handles[key];
waitingCount++;
- if (handle.owner)
- handle.owner.close(checkWaitingCount);
+ if (handle[owner_symbol])
+ handle[owner_symbol].close(checkWaitingCount);
else
handle.close(checkWaitingCount);
}