mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 21:35:34 +00:00

PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
27 lines
649 B
JavaScript
27 lines
649 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const cluster = require('cluster');
|
|
|
|
assert(cluster.isMaster);
|
|
|
|
function emitAndCatch(next) {
|
|
cluster.once('setup', common.mustCall(function(settings) {
|
|
assert.strictEqual(settings.exec, 'new-exec');
|
|
setImmediate(next);
|
|
}));
|
|
cluster.setupMaster({ exec: 'new-exec' });
|
|
}
|
|
|
|
function emitAndCatch2(next) {
|
|
cluster.once('setup', common.mustCall(function(settings) {
|
|
assert('exec' in settings);
|
|
setImmediate(next);
|
|
}));
|
|
cluster.setupMaster();
|
|
}
|
|
|
|
emitAndCatch(common.mustCall(function() {
|
|
emitAndCatch2(common.mustCall(function() {}));
|
|
}));
|