Skip to content

Commit 1438d00

Browse files
Trottitaloacasas
authored andcommitted
benchmark,lib,test: adjust for linting
Formatting changes for upcoming linter update. PR-URL: #10561 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent fb35ca3 commit 1438d00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+471
-447
lines changed

benchmark/url/whatwg-url-properties.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var bench = common.createBenchmark(main, {
1111
'http://user:[email protected]:21/aaa/zzz?l=24#test'
1212
],
1313
prop: ['toString', 'href', 'origin', 'protocol',
14-
'username', 'password', 'host', 'hostname', 'port',
15-
'pathname', 'search', 'searchParams', 'hash'],
14+
'username', 'password', 'host', 'hostname', 'port',
15+
'pathname', 'search', 'searchParams', 'hash'],
1616
n: [1e4]
1717
});
1818

lib/internal/module.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ function stripBOM(content) {
5151
return content;
5252
}
5353

54-
exports.builtinLibs = ['assert', 'buffer', 'child_process', 'cluster',
55-
'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net',
56-
'os', 'path', 'punycode', 'querystring', 'readline', 'repl', 'stream',
57-
'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];
54+
exports.builtinLibs = [
55+
'assert', 'buffer', 'child_process', 'cluster', 'crypto', 'dgram', 'dns',
56+
'domain', 'events', 'fs', 'http', 'https', 'net', 'os', 'path', 'punycode',
57+
'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'tls', 'tty',
58+
'url', 'util', 'v8', 'vm', 'zlib'
59+
];
5860

5961
function addBuiltinLibsToObject(object) {
6062
// Make built-in modules available directly (loaded lazily).

lib/os.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ exports.tmpdir = function() {
5151
return path;
5252
};
5353

54-
exports.tmpDir = internalUtil.deprecate(exports.tmpdir,
55-
'os.tmpDir() is deprecated. Use os.tmpdir() instead.');
54+
const tmpDirDeprecationMsg =
55+
'os.tmpDir() is deprecated. Use os.tmpdir() instead.';
56+
exports.tmpDir = internalUtil.deprecate(exports.tmpdir, tmpDirDeprecationMsg);
5657

5758
exports.getNetworkInterfaces = internalUtil.deprecate(function() {
5859
return exports.networkInterfaces();

lib/repl.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ const debug = util.debuglog('repl');
3939
const parentModule = module;
4040
const replMap = new WeakMap();
4141

42-
const GLOBAL_OBJECT_PROPERTIES = ['NaN', 'Infinity', 'undefined',
43-
'eval', 'parseInt', 'parseFloat', 'isNaN', 'isFinite', 'decodeURI',
44-
'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
45-
'Object', 'Function', 'Array', 'String', 'Boolean', 'Number',
46-
'Date', 'RegExp', 'Error', 'EvalError', 'RangeError',
47-
'ReferenceError', 'SyntaxError', 'TypeError', 'URIError',
48-
'Math', 'JSON'];
42+
const GLOBAL_OBJECT_PROPERTIES = [
43+
'NaN', 'Infinity', 'undefined', 'eval', 'parseInt', 'parseFloat', 'isNaN',
44+
'isFinite', 'decodeURI', 'decodeURIComponent', 'encodeURI',
45+
'encodeURIComponent', 'Object', 'Function', 'Array', 'String', 'Boolean',
46+
'Number', 'Date', 'RegExp', 'Error', 'EvalError', 'RangeError',
47+
'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'Math', 'JSON'
48+
];
4949
const GLOBAL_OBJECT_PROPERTY_MAP = {};
5050
GLOBAL_OBJECT_PROPERTIES.forEach((p) => GLOBAL_OBJECT_PROPERTY_MAP[p] = p);
5151

@@ -1214,12 +1214,13 @@ function addStandardGlobals(completionGroups, filter) {
12141214
// Common keywords. Exclude for completion on the empty string, b/c
12151215
// they just get in the way.
12161216
if (filter) {
1217-
completionGroups.push(['break', 'case', 'catch', 'const',
1218-
'continue', 'debugger', 'default', 'delete', 'do', 'else',
1219-
'export', 'false', 'finally', 'for', 'function', 'if',
1220-
'import', 'in', 'instanceof', 'let', 'new', 'null', 'return',
1221-
'switch', 'this', 'throw', 'true', 'try', 'typeof', 'undefined',
1222-
'var', 'void', 'while', 'with', 'yield']);
1217+
completionGroups.push([
1218+
'break', 'case', 'catch', 'const', 'continue', 'debugger', 'default',
1219+
'delete', 'do', 'else', 'export', 'false', 'finally', 'for', 'function',
1220+
'if', 'import', 'in', 'instanceof', 'let', 'new', 'null', 'return',
1221+
'switch', 'this', 'throw', 'true', 'try', 'typeof', 'undefined', 'var',
1222+
'void', 'while', 'with', 'yield'
1223+
]);
12231224
}
12241225
}
12251226

lib/util.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ function formatValue(ctx, value, recurseTimes) {
404404
if (keys.length === 0) {
405405
if (typeof value === 'function') {
406406
return ctx.stylize(`[Function${value.name ? `: ${value.name}` : ''}]`,
407-
'special');
407+
'special');
408408
}
409409
if (isRegExp(value)) {
410410
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
@@ -664,7 +664,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
664664
for (var i = 0; i < maxLength; ++i) {
665665
if (hasOwnProperty(value, String(i))) {
666666
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
667-
String(i), true));
667+
String(i), true));
668668
} else {
669669
output.push('');
670670
}
@@ -675,7 +675,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
675675
keys.forEach(function(key) {
676676
if (typeof key === 'symbol' || !key.match(/^\d+$/)) {
677677
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
678-
key, true));
678+
key, true));
679679
}
680680
});
681681
return output;

test/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ exports.canCreateSymLink = function() {
470470
// If unix tools are in the path, they can shadow the one we want,
471471
// so use the full path while executing whoami
472472
const whoamiPath = path.join(process.env['SystemRoot'],
473-
'System32', 'whoami.exe');
473+
'System32', 'whoami.exe');
474474

475475
let err = false;
476476
let output = '';

test/inspector/test-inspector.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ function testSetBreakpointAndResume(session) {
114114
const commands = [
115115
{ 'method': 'Debugger.setBreakpointByUrl',
116116
'params': { 'lineNumber': 5,
117-
'url': session.mainScriptPath,
118-
'columnNumber': 0,
119-
'condition': ''
120-
}
117+
'url': session.mainScriptPath,
118+
'columnNumber': 0,
119+
'condition': ''
120+
}
121121
},
122122
{ 'method': 'Debugger.resume'},
123123
[ { 'method': 'Debugger.getScriptSource',

test/internet/test-dns-ipv4.js

+47-45
Original file line numberDiff line numberDiff line change
@@ -36,61 +36,61 @@ function checkWrap(req) {
3636

3737
TEST(function test_resolve4(done) {
3838
const req = dns.resolve4('www.google.com',
39-
common.mustCall((err, ips) => {
40-
assert.ifError(err);
39+
common.mustCall((err, ips) => {
40+
assert.ifError(err);
4141

42-
assert.ok(ips.length > 0);
42+
assert.ok(ips.length > 0);
4343

44-
for (let i = 0; i < ips.length; i++) {
45-
assert.ok(isIPv4(ips[i]));
46-
}
44+
for (let i = 0; i < ips.length; i++) {
45+
assert.ok(isIPv4(ips[i]));
46+
}
4747

48-
done();
49-
}));
48+
done();
49+
}));
5050

5151
checkWrap(req);
5252
});
5353

5454
TEST(function test_reverse_ipv4(done) {
5555
const req = dns.reverse('8.8.8.8',
56-
common.mustCall((err, domains) => {
57-
assert.ifError(err);
56+
common.mustCall((err, domains) => {
57+
assert.ifError(err);
5858

59-
assert.ok(domains.length > 0);
59+
assert.ok(domains.length > 0);
6060

61-
for (let i = 0; i < domains.length; i++) {
62-
assert.ok(domains[i]);
63-
assert.ok(typeof domains[i] === 'string');
64-
}
61+
for (let i = 0; i < domains.length; i++) {
62+
assert.ok(domains[i]);
63+
assert.ok(typeof domains[i] === 'string');
64+
}
6565

66-
done();
67-
}));
66+
done();
67+
}));
6868

6969
checkWrap(req);
7070
});
7171

7272
TEST(function test_lookup_ipv4_explicit(done) {
7373
const req = dns.lookup('www.google.com', 4,
74-
common.mustCall((err, ip, family) => {
75-
assert.ifError(err);
76-
assert.ok(net.isIPv4(ip));
77-
assert.strictEqual(family, 4);
74+
common.mustCall((err, ip, family) => {
75+
assert.ifError(err);
76+
assert.ok(net.isIPv4(ip));
77+
assert.strictEqual(family, 4);
7878

79-
done();
80-
}));
79+
done();
80+
}));
8181

8282
checkWrap(req);
8383
});
8484

8585
TEST(function test_lookup_ipv4_implicit(done) {
8686
const req = dns.lookup('www.google.com',
87-
common.mustCall((err, ip, family) => {
88-
assert.ifError(err);
89-
assert.ok(net.isIPv4(ip));
90-
assert.strictEqual(family, 4);
87+
common.mustCall((err, ip, family) => {
88+
assert.ifError(err);
89+
assert.ok(net.isIPv4(ip));
90+
assert.strictEqual(family, 4);
9191

92-
done();
93-
}));
92+
done();
93+
}));
9494

9595
checkWrap(req);
9696
});
@@ -125,26 +125,26 @@ TEST(function test_lookup_ipv4_hint_addrconfig(done) {
125125

126126
TEST(function test_lookup_ip_ipv4(done) {
127127
const req = dns.lookup('127.0.0.1',
128-
common.mustCall((err, ip, family) => {
129-
assert.ifError(err);
130-
assert.strictEqual(ip, '127.0.0.1');
131-
assert.strictEqual(family, 4);
128+
common.mustCall((err, ip, family) => {
129+
assert.ifError(err);
130+
assert.strictEqual(ip, '127.0.0.1');
131+
assert.strictEqual(family, 4);
132132

133-
done();
134-
}));
133+
done();
134+
}));
135135

136136
checkWrap(req);
137137
});
138138

139139
TEST(function test_lookup_localhost_ipv4(done) {
140140
const req = dns.lookup('localhost', 4,
141-
common.mustCall((err, ip, family) => {
142-
assert.ifError(err);
143-
assert.strictEqual(ip, '127.0.0.1');
144-
assert.strictEqual(family, 4);
141+
common.mustCall((err, ip, family) => {
142+
assert.ifError(err);
143+
assert.strictEqual(ip, '127.0.0.1');
144+
assert.strictEqual(family, 4);
145145

146-
done();
147-
}));
146+
done();
147+
}));
148148

149149
checkWrap(req);
150150
});
@@ -164,21 +164,23 @@ TEST(function test_lookup_all_ipv4(done) {
164164
});
165165

166166
done();
167-
}
168-
));
167+
})
168+
);
169169

170170
checkWrap(req);
171171
});
172172

173173
TEST(function test_lookupservice_ip_ipv4(done) {
174-
const req = dns.lookupService('127.0.0.1', 80,
174+
const req = dns.lookupService(
175+
'127.0.0.1', 80,
175176
common.mustCall((err, host, service) => {
176177
assert.ifError(err);
177178
assert.strictEqual(typeof host, 'string');
178179
assert(host);
179180
assert(['http', 'www', '80'].includes(service));
180181
done();
181-
}));
182+
})
183+
);
182184

183185
checkWrap(req);
184186
});

0 commit comments

Comments
 (0)