summaryrefslogtreecommitdiff
path: root/lib/internal
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal')
-rw-r--r--lib/internal/cluster/master.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js
index 7ee43689c4..8e4f9395da 100644
--- a/lib/internal/cluster/master.js
+++ b/lib/internal/cluster/master.js
@@ -103,11 +103,14 @@ function createWorkerProcess(id, env) {
const workerEnv = util._extend({}, process.env);
const execArgv = cluster.settings.execArgv.slice();
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug-port/;
+ const nodeOptions = process.env.NODE_OPTIONS ?
+ process.env.NODE_OPTIONS : '';
util._extend(workerEnv, env);
workerEnv.NODE_UNIQUE_ID = '' + id;
- if (execArgv.some((arg) => arg.match(debugArgRegex))) {
+ if (execArgv.some((arg) => arg.match(debugArgRegex)) ||
+ nodeOptions.match(debugArgRegex)) {
let inspectPort;
if ('inspectPort' in cluster.settings) {
if (typeof cluster.settings.inspectPort === 'function')