Skip to content

Commit 2eda3c7

Browse files
targosMylesBorins
authored andcommittedFeb 1, 2017
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 f9f8e4e commit 2eda3c7

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed
 

‎lib/timers.js

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

321321
// Make sure we clean up if the callback is no longer a function
322322
// even if the timer is an interval.
323-
if (!this.owner._repeat
324-
|| typeof this.owner._onTimeout !== 'function') {
323+
if (!this.owner._repeat ||
324+
typeof this.owner._onTimeout !== 'function') {
325325
this.owner.close();
326326
}
327327
}

‎test/parallel/test-preload.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,27 @@ var fixtureC = fixture('printC.js');
2424
var fixtureThrows = fixture('throws_error4.js');
2525

2626
// test preloading a single module works
27-
child_process.exec(nodeBinary + ' '
28-
+ preloadOption([fixtureA]) + ' '
29-
+ fixtureB,
27+
child_process.exec(nodeBinary + ' ' +
28+
preloadOption([fixtureA]) + ' ' +
29+
fixtureB,
3030
function(err, stdout, stderr) {
3131
if (err) throw err;
3232
assert.strictEqual(stdout, 'A\nB\n');
3333
});
3434

3535
// test preloading multiple modules works
36-
child_process.exec(nodeBinary + ' '
37-
+ preloadOption([fixtureA, fixtureB]) + ' '
38-
+ fixtureC,
36+
child_process.exec(nodeBinary + ' ' +
37+
preloadOption([fixtureA, fixtureB]) + ' ' +
38+
fixtureC,
3939
function(err, stdout, stderr) {
4040
if (err) throw err;
4141
assert.strictEqual(stdout, 'A\nB\nC\n');
4242
});
4343

4444
// test that preloading a throwing module aborts
45-
child_process.exec(nodeBinary + ' '
46-
+ preloadOption([fixtureA, fixtureThrows]) + ' '
47-
+ fixtureB,
45+
child_process.exec(nodeBinary + ' ' +
46+
preloadOption([fixtureA, fixtureThrows]) + ' ' +
47+
fixtureB,
4848
function(err, stdout, stderr) {
4949
if (err) {
5050
assert.strictEqual(stdout, 'A\n');
@@ -54,39 +54,39 @@ child_process.exec(nodeBinary + ' '
5454
});
5555

5656
// test that preload can be used with --eval
57-
child_process.exec(nodeBinary + ' '
58-
+ preloadOption([fixtureA])
59-
+ '-e "console.log(\'hello\');"',
57+
child_process.exec(nodeBinary + ' ' +
58+
preloadOption([fixtureA]) +
59+
'-e "console.log(\'hello\');"',
6060
function(err, stdout, stderr) {
6161
if (err) throw err;
6262
assert.strictEqual(stdout, 'A\nhello\n');
6363
});
6464

6565
// test that preload placement at other points in the cmdline
6666
// also test that duplicated preload only gets loaded once
67-
child_process.exec(nodeBinary + ' '
68-
+ preloadOption([fixtureA])
69-
+ '-e "console.log(\'hello\');" '
70-
+ preloadOption([fixtureA, fixtureB]),
67+
child_process.exec(nodeBinary + ' ' +
68+
preloadOption([fixtureA]) +
69+
'-e "console.log(\'hello\');" ' +
70+
preloadOption([fixtureA, fixtureB]),
7171
function(err, stdout, stderr) {
7272
if (err) throw err;
7373
assert.strictEqual(stdout, 'A\nB\nhello\n');
7474
});
7575

76-
child_process.exec(nodeBinary + ' '
77-
+ '--require ' + fixture('cluster-preload.js') + ' '
78-
+ fixture('cluster-preload-test.js'),
76+
child_process.exec(nodeBinary + ' ' +
77+
'--require ' + fixture('cluster-preload.js') + ' ' +
78+
fixture('cluster-preload-test.js'),
7979
function(err, stdout, stderr) {
8080
if (err) throw err;
8181
assert.ok(/worker terminated with code 43/.test(stdout));
8282
});
8383

8484
// https://github.com/nodejs/node/issues/1691
8585
process.chdir(common.fixturesDir);
86-
child_process.exec(nodeBinary + ' '
87-
+ '--expose_debug_as=v8debug '
88-
+ '--require ' + fixture('cluster-preload.js') + ' '
89-
+ 'cluster-preload-test.js',
86+
child_process.exec(nodeBinary + ' ' +
87+
'--expose_debug_as=v8debug ' +
88+
'--require ' + fixture('cluster-preload.js') + ' ' +
89+
'cluster-preload-test.js',
9090
function(err, stdout, stderr) {
9191
if (err) throw err;
9292
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
]);

0 commit comments

Comments
 (0)
Please sign in to comment.