| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cc7fdf4 commit fc0ed2e
30 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - if (process.argv[2] === 'child') | ||
| 3 | - { | ||
| 2 | + if (process.argv[2] === 'child') { | ||
| 4 | 3 | const len = +process.argv[3]; | |
| 5 | 4 | const msg = `"${'.'.repeat(len)}"`; | |
| 6 | 5 | while (true) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -803,9 +803,11 @@ Readable.prototype.wrap = function(stream) { | |||
| 803 | 803 | // important when wrapping filters and duplexes. | |
| 804 | 804 | for (var i in stream) { | |
| 805 | 805 | if (this[i] === undefined && typeof stream[i] === 'function') { | |
| 806 | - this[i] = function(method) { return function() { | ||
| 807 | - return stream[method].apply(stream, arguments); | ||
| 808 | - }; }(i); | ||
| 806 | + this[i] = function(method) { | ||
| 807 | + return function() { | ||
| 808 | + return stream[method].apply(stream, arguments); | ||
| 809 | + }; | ||
| 810 | + }(i); | ||
| 809 | 811 | } | |
| 810 | 812 | } | |
| 811 | 813 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -622,8 +622,7 @@ Module._preloadModules = function(requests) { | |||
| 622 | 622 | var parent = new Module('internal/preload', null); | |
| 623 | 623 | try { | |
| 624 | 624 | parent.paths = Module._nodeModulePaths(process.cwd()); | |
| 625 | - } | ||
| 626 | - catch (e) { | ||
| 625 | + } catch (e) { | ||
| 627 | 626 | if (e.code !== 'ENOENT') { | |
| 628 | 627 | throw e; | |
| 629 | 628 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1158,8 +1158,7 @@ function createServerHandle(address, port, addressType, fd) { | |||
| 1158 | 1158 | if (typeof fd === 'number' && fd >= 0) { | |
| 1159 | 1159 | try { | |
| 1160 | 1160 | handle = createHandle(fd); | |
| 1161 | - } | ||
| 1162 | - catch (e) { | ||
| 1161 | + } catch (e) { | ||
| 1163 | 1162 | // Not a fd we can listen on. This will trigger an error. | |
| 1164 | 1163 | debug('listen invalid fd=' + fd + ': ' + e.message); | |
| 1165 | 1164 | return uv.UV_EINVAL; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,8 +96,7 @@ if (process.argv[2] !== 'child') { | |||
| 96 | 96 | //all child process are listening, so start sending | |
| 97 | 97 | sendSocket.sendNext(); | |
| 98 | 98 | } | |
| 99 | - } | ||
| 100 | - else if (msg.message) { | ||
| 99 | + } else if (msg.message) { | ||
| 101 | 100 | worker.messagesReceived.push(msg.message); | |
| 102 | 101 | ||
| 103 | 102 | if (worker.messagesReceived.length === messages.length) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,13 +12,11 @@ if (process.env.FORK) { | |||
| 12 | 12 | assert.equal(process.argv[0], copyPath); | |
| 13 | 13 | process.send(msg); | |
| 14 | 14 | process.exit(); | |
| 15 | - } | ||
| 16 | - else { | ||
| 15 | + } else { | ||
| 17 | 16 | common.refreshTmpDir(); | |
| 18 | 17 | try { | |
| 19 | 18 | fs.unlinkSync(copyPath); | |
| 20 | - } | ||
| 21 | - catch (e) { | ||
| 19 | + } catch (e) { | ||
| 22 | 20 | if (e.code !== 'ENOENT') throw e; | |
| 23 | 21 | } | |
| 24 | 22 | fs.writeFileSync(copyPath, fs.readFileSync(nodePath)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,14 +49,12 @@ function worker() { | |||
| 49 | 49 | if (n === 1) { | |
| 50 | 50 | assert.equal(msg, 'one'); | |
| 51 | 51 | assert.equal(handle, undefined); | |
| 52 | - } | ||
| 53 | - else if (n === 2) { | ||
| 52 | + } else if (n === 2) { | ||
| 54 | 53 | assert.equal(msg, 'two'); | |
| 55 | 54 | assert.equal(typeof handle, 'object'); // Also matches null, therefore... | |
| 56 | 55 | assert.ok(handle); // also check that it's truthy. | |
| 57 | 56 | handle.close(); | |
| 58 | - } | ||
| 59 | - else if (n === 3) { | ||
| 57 | + } else if (n === 3) { | ||
| 60 | 58 | assert.equal(msg, 'three'); | |
| 61 | 59 | assert.equal(handle, undefined); | |
| 62 | 60 | process.exit(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,7 @@ if (cluster.isWorker) { | |||
| 18 | 18 | http.Server(function() { | |
| 19 | 19 | ||
| 20 | 20 | }).listen(common.PORT, '127.0.0.1'); | |
| 21 | - } | ||
| 22 | - | ||
| 23 | - else if (cluster.isMaster) { | ||
| 21 | + } else if (cluster.isMaster) { | ||
| 24 | 22 | ||
| 25 | 23 | var checks = { | |
| 26 | 24 | cluster: { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,8 +18,7 @@ if (cluster.isMaster) { | |||
| 18 | 18 | cluster.fork().on('exit', common.mustCall(function(exitCode) { | |
| 19 | 19 | assert.equal(exitCode, 0); | |
| 20 | 20 | })); | |
| 21 | - } | ||
| 22 | - else { | ||
| 21 | + } else { | ||
| 23 | 22 | var s = net.createServer(common.fail); | |
| 24 | 23 | s.listen(42, common.fail.bind(null, 'listen should have failed')); | |
| 25 | 24 | s.on('error', common.mustCall(function(err) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,8 +64,7 @@ if (!id) { | |||
| 64 | 64 | process.on('exit', function() { | |
| 65 | 65 | assert(ok); | |
| 66 | 66 | }); | |
| 67 | - } | ||
| 68 | - else if (id === 'one') { | ||
| 67 | + } else if (id === 'one') { | ||
| 69 | 68 | if (cluster.isMaster) return startWorker(); | |
| 70 | 69 | ||
| 71 | 70 | http.createServer(common.fail).listen(common.PORT, function() { | |
@@ -75,8 +74,7 @@ else if (id === 'one') { | |||
| 75 | 74 | process.on('message', function(m) { | |
| 76 | 75 | if (m === 'QUIT') process.exit(); | |
| 77 | 76 | }); | |
| 78 | - } | ||
| 79 | - else if (id === 'two') { | ||
| 77 | + } else if (id === 'two') { | ||
| 80 | 78 | if (cluster.isMaster) return startWorker(); | |
| 81 | 79 | ||
| 82 | 80 | let ok = false; | |
@@ -96,8 +94,7 @@ else if (id === 'two') { | |||
| 96 | 94 | ok = true; | |
| 97 | 95 | }); | |
| 98 | 96 | }); | |
| 99 | - } | ||
| 100 | - else { | ||
| 97 | + } else { | ||
| 101 | 98 | assert(0); // bad command line argument | |
| 102 | 99 | } | |
| 103 | 100 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments