Skip to content

Commit 955c90d

Browse files
Trottevanlucas
authored andcommitted
benchmark,test,lib: remove extra spaces
In preparation for stricter linting, remove extra spaces. PR-URL: #6645 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent c63687d commit 955c90d

30 files changed

+69
-69
lines changed

benchmark/buffers/buffer-write.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ var bench = common.createBenchmark(main, {
1212
millions: [1]
1313
});
1414

15-
const INT8 = 0x7f;
16-
const INT16 = 0x7fff;
17-
const INT32 = 0x7fffffff;
18-
const UINT8 = (INT8 * 2) + 1;
15+
const INT8 = 0x7f;
16+
const INT16 = 0x7fff;
17+
const INT32 = 0x7fffffff;
18+
const UINT8 = (INT8 * 2) + 1;
1919
const UINT16 = (INT16 * 2) + 1;
2020
const UINT32 = INT32;
2121

benchmark/buffers/dataview-set.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ var bench = common.createBenchmark(main, {
1010
millions: [1]
1111
});
1212

13-
const INT8 = 0x7f;
14-
const INT16 = 0x7fff;
15-
const INT32 = 0x7fffffff;
16-
const UINT8 = INT8 * 2;
13+
const INT8 = 0x7f;
14+
const INT16 = 0x7fff;
15+
const INT32 = 0x7fffffff;
16+
const UINT8 = INT8 * 2;
1717
const UINT16 = INT16 * 2;
1818
const UINT32 = INT32 * 2;
1919

lib/internal/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function setupHistory(repl, historyPath, oldHistoryPath, ready) {
133133
`the new one i.e., ${historyPath} and is empty.\nUsing it as is.\n`);
134134
repl._refreshLine();
135135

136-
} else if (oldHistoryPath) {
136+
} else if (oldHistoryPath) {
137137
// Grab data from the older pre-v3.0 JSON NODE_REPL_HISTORY_FILE format.
138138
repl._writeToOutput(
139139
'\nConverting old JSON repl history to line-separated history.\n' +

lib/path.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ const win32 = {
779779
end = i;
780780
break;
781781
}
782-
} else {
782+
} else {
783783
// We saw the first non-path separator
784784
matchedSlash = false;
785785
}
@@ -1335,7 +1335,7 @@ const posix = {
13351335
end = i;
13361336
break;
13371337
}
1338-
} else {
1338+
} else {
13391339
// We saw the first non-path separator
13401340
matchedSlash = false;
13411341
}

lib/querystring.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ QueryString.unescapeBuffer = function(s, decodeSpaces) {
5858
case 2: // Second hex digit
5959
state = 0;
6060
if (c >= 48/*0*/ && c <= 57/*9*/) {
61-
m = c - 48/*0*/;
61+
m = c - 48/*0*/;
6262
} else if (c >= 65/*A*/ && c <= 70/*F*/) {
6363
m = c - 65/*A*/ + 10;
6464
} else if (c >= 97/*a*/ && c <= 102/*f*/) {

lib/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class LineParser {
156156

157157
this.shouldFail = this.shouldFail ||
158158
((!this._literal && lastChar === '\\') ||
159-
(this._literal && lastChar !== '\\'));
159+
(this._literal && lastChar !== '\\'));
160160

161161
return line;
162162
}

lib/tls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function convertProtocols(protocols) {
5050
return buff;
5151
}
5252

53-
exports.convertNPNProtocols = function(protocols, out) {
53+
exports.convertNPNProtocols = function(protocols, out) {
5454
// If protocols is Array - translate it into buffer
5555
if (Array.isArray(protocols)) {
5656
protocols = convertProtocols(protocols);

test/addons/buffer-free-callback/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ check(64, 1, 0);
2222
check(97, 1, 0);
2323

2424
// Buffers can be unaligned
25-
check(64, 8, 0);
25+
check(64, 8, 0);
2626
check(64, 16, 0);
27-
check(64, 8, 1);
27+
check(64, 8, 1);
2828
check(64, 16, 1);
29-
check(97, 8, 1);
29+
check(97, 8, 1);
3030
check(97, 16, 1);
31-
check(97, 8, 3);
31+
check(97, 8, 3);
3232
check(97, 16, 3);
3333

3434
// Empty ArrayBuffer does not allocate data, worth checking

test/gc/test-http-client-connaborted.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function serverHandler(req, res) {
66
res.connection.destroy();
77
}
88

9-
const http = require('http');
9+
const http = require('http');
1010
const weak = require('weak');
1111
const common = require('../common');
1212
const assert = require('assert');

test/parallel/test-buffer-alloc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ Buffer.from(Buffer.allocUnsafe(0), 0, 0);
10231023
[ 'utf9',
10241024
'utf-7',
10251025
'Unicode-FTW',
1026-
'new gnu gun' ].forEach(function(enc) {
1026+
'new gnu gun' ].forEach(function(enc) {
10271027
assert.equal(Buffer.isEncoding(enc), false);
10281028
});
10291029

test/parallel/test-buffer-concat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require('../common');
33
var assert = require('assert');
44

55
var zero = [];
6-
var one = [ Buffer.from('asdf') ];
6+
var one = [ Buffer.from('asdf') ];
77
var long = [];
88
for (var i = 0; i < 10; i++) long.push(Buffer.from('asdf'));
99

test/parallel/test-buffer-includes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ assert(!mixedByteStringUtf8.includes('\u0396'));
164164
// Long string that isn't a simple repeat of a shorter string.
165165
var longString = 'A';
166166
for (let i = 66; i < 76; i++) { // from 'B' to 'K'
167-
longString = longString + String.fromCharCode(i) + longString;
167+
longString = longString + String.fromCharCode(i) + longString;
168168
}
169169

170170
const longBufferString = Buffer.from(longString);

test/parallel/test-buffer-indexof.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ assert.equal(-1, mixedByteStringUtf8.indexOf('\u0396'));
183183
// Long string that isn't a simple repeat of a shorter string.
184184
var longString = 'A';
185185
for (let i = 66; i < 76; i++) { // from 'B' to 'K'
186-
longString = longString + String.fromCharCode(i) + longString;
186+
longString = longString + String.fromCharCode(i) + longString;
187187
}
188188

189189
var longBufferString = Buffer.from(longString);

test/parallel/test-buffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ Buffer(Buffer(0), 0, 0);
10161016
[ 'utf9',
10171017
'utf-7',
10181018
'Unicode-FTW',
1019-
'new gnu gun' ].forEach(function(enc) {
1019+
'new gnu gun' ].forEach(function(enc) {
10201020
assert.equal(Buffer.isEncoding(enc), false);
10211021
});
10221022

test/parallel/test-crypto-fips.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function testHelper(stream, args, expectedOutput, cmd, env) {
4141
cmd + ' and args \'' + args + '\'');
4242

4343
function childOk(child) {
44-
console.error('Child #' + ++num_children_ok +
44+
console.error('Child #' + ++num_children_ok +
4545
' [pid:' + child.pid + '] OK.');
4646
}
4747

test/parallel/test-crypto-padding-aes256.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var crypto = require('crypto');
1111
crypto.DEFAULT_ENCODING = 'buffer';
1212

1313
function aes256(decipherFinal) {
14-
var iv = Buffer.from('00000000000000000000000000000000', 'hex');
14+
var iv = Buffer.from('00000000000000000000000000000000', 'hex');
1515
var key = Buffer.from('0123456789abcdef0123456789abcdef' +
1616
'0123456789abcdef0123456789abcdef', 'hex');
1717

test/parallel/test-dgram-send-bad-arguments.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ assert.throws(function() {
1212
}, TypeError); // First argument should be a buffer.
1313

1414
// send(buf, offset, length, port, host)
15-
assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError);
16-
assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError);
15+
assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError);
16+
assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError);
1717
assert.throws(function() { sock.send(buf, 1, 1, 65536, host); }, RangeError);
1818

1919
// send(buf, port, host)
20-
assert.throws(function() { sock.send(23, 12345, host); }, TypeError);
20+
assert.throws(function() { sock.send(23, 12345, host); }, TypeError);
2121

2222
// send([buf1, ..], port, host)
2323
assert.throws(function() { sock.send([buf, 23], 12345, host); }, TypeError);

test/parallel/test-domain-abort-on-uncaught.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ if (process.argv[2] === 'child') {
239239
testCmd += 'ulimit -c 0 && ';
240240
}
241241

242-
testCmd += process.argv[0];
242+
testCmd += process.argv[0];
243243
testCmd += ' ' + '--abort-on-uncaught-exception';
244244
testCmd += ' ' + process.argv[1];
245245
testCmd += ' ' + 'child';

test/parallel/test-domain-no-error-handler-abort-on-uncaught.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ if (process.argv[2] === 'child') {
150150
testCmd += 'ulimit -c 0 && ';
151151
}
152152

153-
testCmd += process.argv[0];
153+
testCmd += process.argv[0];
154154
testCmd += ' ' + '--abort-on-uncaught-exception';
155155
testCmd += ' ' + process.argv[1];
156156
testCmd += ' ' + 'child';

test/parallel/test-domain-with-abort-on-uncaught-exception.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ if (process.argv[2] === 'child') {
103103
if (options.useTryCatch)
104104
useTryCatchOpt = 'useTryCatch';
105105

106-
cmdToExec += process.argv[0] + ' ';
106+
cmdToExec += process.argv[0] + ' ';
107107
cmdToExec += (cmdLineOption ? cmdLineOption : '') + ' ';
108108
cmdToExec += process.argv[1] + ' ';
109109
cmdToExec += [

test/parallel/test-fs-null-bytes.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,33 @@ function check(async, sync) {
2121
async.apply(null, argsAsync);
2222
}
2323

24-
check(fs.access, fs.accessSync, 'foo\u0000bar');
25-
check(fs.access, fs.accessSync, 'foo\u0000bar', fs.F_OK);
26-
check(fs.appendFile, fs.appendFileSync, 'foo\u0000bar');
27-
check(fs.chmod, fs.chmodSync, 'foo\u0000bar', '0644');
28-
check(fs.chown, fs.chownSync, 'foo\u0000bar', 12, 34);
29-
check(fs.link, fs.linkSync, 'foo\u0000bar', 'foobar');
30-
check(fs.link, fs.linkSync, 'foobar', 'foo\u0000bar');
31-
check(fs.lstat, fs.lstatSync, 'foo\u0000bar');
32-
check(fs.mkdir, fs.mkdirSync, 'foo\u0000bar', '0755');
33-
check(fs.open, fs.openSync, 'foo\u0000bar', 'r');
34-
check(fs.readFile, fs.readFileSync, 'foo\u0000bar');
35-
check(fs.readdir, fs.readdirSync, 'foo\u0000bar');
36-
check(fs.readlink, fs.readlinkSync, 'foo\u0000bar');
37-
check(fs.realpath, fs.realpathSync, 'foo\u0000bar');
38-
check(fs.rename, fs.renameSync, 'foo\u0000bar', 'foobar');
39-
check(fs.rename, fs.renameSync, 'foobar', 'foo\u0000bar');
40-
check(fs.rmdir, fs.rmdirSync, 'foo\u0000bar');
41-
check(fs.stat, fs.statSync, 'foo\u0000bar');
42-
check(fs.symlink, fs.symlinkSync, 'foo\u0000bar', 'foobar');
43-
check(fs.symlink, fs.symlinkSync, 'foobar', 'foo\u0000bar');
44-
check(fs.truncate, fs.truncateSync, 'foo\u0000bar');
45-
check(fs.unlink, fs.unlinkSync, 'foo\u0000bar');
46-
check(null, fs.unwatchFile, 'foo\u0000bar', common.fail);
47-
check(fs.utimes, fs.utimesSync, 'foo\u0000bar', 0, 0);
48-
check(null, fs.watch, 'foo\u0000bar', common.fail);
49-
check(null, fs.watchFile, 'foo\u0000bar', common.fail);
50-
check(fs.writeFile, fs.writeFileSync, 'foo\u0000bar');
24+
check(fs.access, fs.accessSync, 'foo\u0000bar');
25+
check(fs.access, fs.accessSync, 'foo\u0000bar', fs.F_OK);
26+
check(fs.appendFile, fs.appendFileSync, 'foo\u0000bar');
27+
check(fs.chmod, fs.chmodSync, 'foo\u0000bar', '0644');
28+
check(fs.chown, fs.chownSync, 'foo\u0000bar', 12, 34);
29+
check(fs.link, fs.linkSync, 'foo\u0000bar', 'foobar');
30+
check(fs.link, fs.linkSync, 'foobar', 'foo\u0000bar');
31+
check(fs.lstat, fs.lstatSync, 'foo\u0000bar');
32+
check(fs.mkdir, fs.mkdirSync, 'foo\u0000bar', '0755');
33+
check(fs.open, fs.openSync, 'foo\u0000bar', 'r');
34+
check(fs.readFile, fs.readFileSync, 'foo\u0000bar');
35+
check(fs.readdir, fs.readdirSync, 'foo\u0000bar');
36+
check(fs.readlink, fs.readlinkSync, 'foo\u0000bar');
37+
check(fs.realpath, fs.realpathSync, 'foo\u0000bar');
38+
check(fs.rename, fs.renameSync, 'foo\u0000bar', 'foobar');
39+
check(fs.rename, fs.renameSync, 'foobar', 'foo\u0000bar');
40+
check(fs.rmdir, fs.rmdirSync, 'foo\u0000bar');
41+
check(fs.stat, fs.statSync, 'foo\u0000bar');
42+
check(fs.symlink, fs.symlinkSync, 'foo\u0000bar', 'foobar');
43+
check(fs.symlink, fs.symlinkSync, 'foobar', 'foo\u0000bar');
44+
check(fs.truncate, fs.truncateSync, 'foo\u0000bar');
45+
check(fs.unlink, fs.unlinkSync, 'foo\u0000bar');
46+
check(null, fs.unwatchFile, 'foo\u0000bar', common.fail);
47+
check(fs.utimes, fs.utimesSync, 'foo\u0000bar', 0, 0);
48+
check(null, fs.watch, 'foo\u0000bar', common.fail);
49+
check(null, fs.watchFile, 'foo\u0000bar', common.fail);
50+
check(fs.writeFile, fs.writeFileSync, 'foo\u0000bar');
5151

5252
// an 'error' for exists means that it doesn't exist.
5353
// one of many reasons why this file is the absolute worst.

test/parallel/test-https-agent-session-eviction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ https.createServer(options, function(req, res) {
2626
});
2727

2828
// Do request and let agent cache the session
29-
function first(server) {
29+
function first(server) {
3030
const req = https.request({
3131
port: common.PORT,
3232
rejectUnauthorized: false

test/parallel/test-regress-GH-7511.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ const vm = require('vm');
55

66
assert.doesNotThrow(function() {
77
var context = vm.createContext({ process: process });
8-
var result = vm.runInContext('process.env["PATH"]', context);
8+
var result = vm.runInContext('process.env["PATH"]', context);
99
assert.notEqual(undefined, result);
1010
});

test/parallel/test-repl-domain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
var common = require('../common');
33

4-
var repl = require('repl');
4+
var repl = require('repl');
55

66
const putIn = new common.ArrayStream();
77
repl.start('', putIn);

test/parallel/test-stream2-writable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ test('end callback after .write() call', function(t) {
258258
test('end callback called after write callback', function(t) {
259259
var tw = new TestWriter();
260260
var writeCalledback = false;
261-
tw.write(Buffer.from('hello world'), function() {
261+
tw.write(Buffer.from('hello world'), function() {
262262
writeCalledback = true;
263263
});
264264
tw.end(function() {

test/parallel/test-string-decoder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test(
2727
test('ucs2', Buffer.from('ababc', 'ucs2'), 'ababc');
2828

2929
// UTF-16LE
30-
test('ucs2', Buffer.from('3DD84DDC', 'hex'), '\ud83d\udc4d'); // thumbs up
30+
test('ucs2', Buffer.from('3DD84DDC', 'hex'), '\ud83d\udc4d'); // thumbs up
3131

3232
console.log(' crayon!');
3333

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (!common.hasCrypto) {
99
var tls = require('tls');
1010

1111
var fs = require('fs');
12-
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
12+
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
1313
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');
1414

1515
var ntests = 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (!common.hasCrypto) {
99
var tls = require('tls');
1010

1111
var fs = require('fs');
12-
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
12+
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
1313
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');
1414

1515
var nsuccess = 0;

test/parallel/test-tls-dhe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var tls = require('tls');
1010

1111
var spawn = require('child_process').spawn;
1212
var fs = require('fs');
13-
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
13+
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
1414
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');
1515
var nsuccess = 0;
1616
var ntests = 0;

test/timers/test-timers-reliability.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
require('../common');
55

6-
var Timer = process.binding('timer_wrap').Timer;
6+
var Timer = process.binding('timer_wrap').Timer;
77
var assert = require('assert');
88

9-
var timerFired = false;
9+
var timerFired = false;
1010
var intervalFired = false;
1111

1212
/*

0 commit comments

Comments
 (0)