mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 02:42:08 +00:00

Replace var keyword with const or let. PR-URL: https://github.com/nodejs/io.js/pull/2286 Reviewed-By: Roman Reiss <me@silverwind.io>
37 lines
722 B
JavaScript
37 lines
722 B
JavaScript
'use strict';
|
|
const assert = require('assert');
|
|
const common = require('../common');
|
|
const fork = require('child_process').fork;
|
|
|
|
var cp = fork(common.fixturesDir + '/child-process-message-and-exit.js');
|
|
|
|
let gotMessage = false;
|
|
let gotExit = false;
|
|
let gotClose = false;
|
|
|
|
cp.on('message', function(message) {
|
|
assert(!gotMessage);
|
|
assert(!gotClose);
|
|
assert.strictEqual(message, 'hello');
|
|
gotMessage = true;
|
|
});
|
|
|
|
cp.on('exit', function() {
|
|
assert(!gotExit);
|
|
assert(!gotClose);
|
|
gotExit = true;
|
|
});
|
|
|
|
cp.on('close', function() {
|
|
assert(gotMessage);
|
|
assert(gotExit);
|
|
assert(!gotClose);
|
|
gotClose = true;
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert(gotMessage);
|
|
assert(gotExit);
|
|
assert(gotClose);
|
|
});
|