Skip to content

Commit b6a8bc6

Browse files
targosFishrock123
authored andcommitted
lib,test: use consistent operator linebreak style
We have a tacit rule that for multiline statements, the operator should be placed before the linebreak. This commit commit fixes the few violations of this rule in the code base. This allows us to enable the corresponding ESLint rule. PR-URL: #10178 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent b44e789 commit b6a8bc6

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

lib/timers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ function unrefdHandle() {
473473

474474
// Make sure we clean up if the callback is no longer a function
475475
// even if the timer is an interval.
476-
if (!this.owner._repeat
477-
|| typeof this.owner._onTimeout !== 'function') {
476+
if (!this.owner._repeat ||
477+
typeof this.owner._onTimeout !== 'function') {
478478
this.owner.close();
479479
}
480480
}

test/parallel/test-preload.js

+26-26
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ const fixtureD = fixture('define-global.js');
3232
const fixtureThrows = fixture('throws_error4.js');
3333

3434
// test preloading a single module works
35-
childProcess.exec(nodeBinary + ' '
36-
+ preloadOption([fixtureA]) + ' '
37-
+ fixtureB,
35+
childProcess.exec(nodeBinary + ' ' +
36+
preloadOption([fixtureA]) + ' ' +
37+
fixtureB,
3838
function(err, stdout, stderr) {
3939
if (err) throw err;
4040
assert.strictEqual(stdout, 'A\nB\n');
4141
});
4242

4343
// test preloading multiple modules works
44-
childProcess.exec(nodeBinary + ' '
45-
+ preloadOption([fixtureA, fixtureB]) + ' '
46-
+ fixtureC,
44+
childProcess.exec(nodeBinary + ' ' +
45+
preloadOption([fixtureA, fixtureB]) + ' ' +
46+
fixtureC,
4747
function(err, stdout, stderr) {
4848
if (err) throw err;
4949
assert.strictEqual(stdout, 'A\nB\nC\n');
5050
});
5151

5252
// test that preloading a throwing module aborts
53-
childProcess.exec(nodeBinary + ' '
54-
+ preloadOption([fixtureA, fixtureThrows]) + ' '
55-
+ fixtureB,
53+
childProcess.exec(nodeBinary + ' ' +
54+
preloadOption([fixtureA, fixtureThrows]) + ' ' +
55+
fixtureB,
5656
function(err, stdout, stderr) {
5757
if (err) {
5858
assert.strictEqual(stdout, 'A\n');
@@ -62,9 +62,9 @@ childProcess.exec(nodeBinary + ' '
6262
});
6363

6464
// test that preload can be used with --eval
65-
childProcess.exec(nodeBinary + ' '
66-
+ preloadOption([fixtureA])
67-
+ '-e "console.log(\'hello\');"',
65+
childProcess.exec(nodeBinary + ' ' +
66+
preloadOption([fixtureA]) +
67+
'-e "console.log(\'hello\');"',
6868
function(err, stdout, stderr) {
6969
if (err) throw err;
7070
assert.strictEqual(stdout, 'A\nhello\n');
@@ -108,19 +108,19 @@ replProc.on('close', function(code) {
108108

109109
// test that preload placement at other points in the cmdline
110110
// also test that duplicated preload only gets loaded once
111-
childProcess.exec(nodeBinary + ' '
112-
+ preloadOption([fixtureA])
113-
+ '-e "console.log(\'hello\');" '
114-
+ preloadOption([fixtureA, fixtureB]),
111+
childProcess.exec(nodeBinary + ' ' +
112+
preloadOption([fixtureA]) +
113+
'-e "console.log(\'hello\');" ' +
114+
preloadOption([fixtureA, fixtureB]),
115115
function(err, stdout, stderr) {
116116
if (err) throw err;
117117
assert.strictEqual(stdout, 'A\nB\nhello\n');
118118
});
119119

120120
// test that preload works with -i
121-
const interactive = childProcess.exec(nodeBinary + ' '
122-
+ preloadOption([fixtureD])
123-
+ '-i',
121+
const interactive = childProcess.exec(nodeBinary + ' ' +
122+
preloadOption([fixtureD]) +
123+
'-i',
124124
common.mustCall(function(err, stdout, stderr) {
125125
assert.ifError(err);
126126
assert.strictEqual(stdout, "> 'test'\n> ");
@@ -129,20 +129,20 @@ const interactive = childProcess.exec(nodeBinary + ' '
129129
interactive.stdin.write('a\n');
130130
interactive.stdin.write('process.exit()\n');
131131

132-
childProcess.exec(nodeBinary + ' '
133-
+ '--require ' + fixture('cluster-preload.js') + ' '
134-
+ fixture('cluster-preload-test.js'),
132+
childProcess.exec(nodeBinary + ' ' +
133+
'--require ' + fixture('cluster-preload.js') + ' ' +
134+
fixture('cluster-preload-test.js'),
135135
function(err, stdout, stderr) {
136136
if (err) throw err;
137137
assert.ok(/worker terminated with code 43/.test(stdout));
138138
});
139139

140140
// https://github.com/nodejs/node/issues/1691
141141
process.chdir(common.fixturesDir);
142-
childProcess.exec(nodeBinary + ' '
143-
+ '--expose_debug_as=v8debug '
144-
+ '--require ' + fixture('cluster-preload.js') + ' '
145-
+ 'cluster-preload-test.js',
142+
childProcess.exec(nodeBinary + ' ' +
143+
'--expose_debug_as=v8debug ' +
144+
'--require ' + fixture('cluster-preload.js') + ' ' +
145+
'cluster-preload-test.js',
146146
function(err, stdout, stderr) {
147147
if (err) throw err;
148148
assert.ok(/worker terminated with code 43/.test(stdout));

test/parallel/test-repl-domain.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ putIn.write = function(data) {
1818
};
1919

2020
putIn.run([
21-
'require("domain").create().on("error", function() { console.log("OK") })'
22-
+ '.run(function() { throw new Error("threw") })'
21+
'require("domain").create().on("error", function() { console.log("OK") })' +
22+
'.run(function() { throw new Error("threw") })'
2323
]);

test/parallel/test-tls-client-mindhsize.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ function test(size, err, next) {
5353
if (err) {
5454
client.on('error', function(e) {
5555
nerror++;
56-
assert.strictEqual(e.message, 'DH parameter size 1024 is less'
57-
+ ' than 2048');
56+
assert.strictEqual(e.message, 'DH parameter size 1024 is less' +
57+
' than 2048');
5858
server.close();
5959
});
6060
}

0 commit comments

Comments
 (0)