| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2388648 commit 1d54f07
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,26 +4,23 @@ | |||
| 4 | 4 | // https://github.com/joyent/node/issues/2556 | |
| 5 | 5 | ||
| 6 | 6 | const common = require('../common'); | |
| 7 | - var assert = require('assert'); | ||
| 8 | - var cluster = require('cluster'); | ||
| 9 | - var fork = require('child_process').fork; | ||
| 7 | + const assert = require('assert'); | ||
| 8 | + const cluster = require('cluster'); | ||
| 9 | + const fork = require('child_process').fork; | ||
| 10 | 10 | ||
| 11 | - var MAGIC_EXIT_CODE = 42; | ||
| 11 | + const MAGIC_EXIT_CODE = 42; | ||
| 12 | 12 | ||
| 13 | - var isTestRunner = process.argv[2] != 'child'; | ||
| 13 | + const isTestRunner = process.argv[2] !== 'child'; | ||
| 14 | 14 | ||
| 15 | 15 | if (isTestRunner) { | |
| 16 | - var master = fork(__filename, ['child']); | ||
| 17 | - master.on('exit', common.mustCall(function(code) { | ||
| 16 | + const master = fork(__filename, ['child']); | ||
| 17 | + master.on('exit', common.mustCall((code) => { | ||
| 18 | 18 | assert.strictEqual(code, MAGIC_EXIT_CODE); | |
| 19 | 19 | })); | |
| 20 | 20 | } else if (cluster.isMaster) { | |
| 21 | - process.on('uncaughtException', function() { | ||
| 22 | - process.nextTick(function() { | ||
| 23 | - process.exit(MAGIC_EXIT_CODE); | ||
| 24 | - }); | ||
| 25 | - }); | ||
| 26 | - | ||
| 21 | + process.on('uncaughtException', common.mustCall(() => { | ||
| 22 | + process.nextTick(() => process.exit(MAGIC_EXIT_CODE)); | ||
| 23 | + })); | ||
| 27 | 24 | cluster.fork(); | |
| 28 | 25 | throw new Error('kill master'); | |
| 29 | 26 | } else { // worker | |
| Back | FazBrowse Home | New Git URL |
0 commit comments