Skip to content

Commit b4cf8c4

Browse files
TrottMylesBorins
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 c8d2ca7 commit b4cf8c4

Some content is hidden

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

42 files changed

+454
-429
lines changed

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/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

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

lib/util.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function formatValue(ctx, value, recurseTimes) {
400400
if (keys.length === 0) {
401401
if (typeof value === 'function') {
402402
return ctx.stylize(`[Function${value.name ? `: ${value.name}` : ''}]`,
403-
'special');
403+
'special');
404404
}
405405
if (isRegExp(value)) {
406406
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
@@ -659,7 +659,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
659659
for (var i = 0; i < maxLength; ++i) {
660660
if (hasOwnProperty(value, String(i))) {
661661
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
662-
String(i), true));
662+
String(i), true));
663663
} else {
664664
output.push('');
665665
}
@@ -670,7 +670,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
670670
keys.forEach(function(key) {
671671
if (typeof key === 'symbol' || !key.match(/^\d+$/)) {
672672
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
673-
key, true));
673+
key, true));
674674
}
675675
});
676676
return 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
});

test/internet/test-dns-ipv6.js

+32-30
Original file line numberDiff line numberDiff line change
@@ -41,45 +41,45 @@ function checkWrap(req) {
4141

4242
TEST(function test_resolve6(done) {
4343
const req = dns.resolve6('ipv6.google.com',
44-
common.mustCall((err, ips) => {
45-
assert.ifError(err);
44+
common.mustCall((err, ips) => {
45+
assert.ifError(err);
4646

47-
assert.ok(ips.length > 0);
47+
assert.ok(ips.length > 0);
4848

49-
for (let i = 0; i < ips.length; i++)
50-
assert.ok(isIPv6(ips[i]));
49+
for (let i = 0; i < ips.length; i++)
50+
assert.ok(isIPv6(ips[i]));
5151

52-
done();
53-
}));
52+
done();
53+
}));
5454

5555
checkWrap(req);
5656
});
5757

5858
TEST(function test_reverse_ipv6(done) {
5959
const req = dns.reverse('2001:4860:4860::8888',
60-
common.mustCall((err, domains) => {
61-
assert.ifError(err);
60+
common.mustCall((err, domains) => {
61+
assert.ifError(err);
6262

63-
assert.ok(domains.length > 0);
63+
assert.ok(domains.length > 0);
6464

65-
for (let i = 0; i < domains.length; i++)
66-
assert.ok(typeof domains[i] === 'string');
65+
for (let i = 0; i < domains.length; i++)
66+
assert.ok(typeof domains[i] === 'string');
6767

68-
done();
69-
}));
68+
done();
69+
}));
7070

7171
checkWrap(req);
7272
});
7373

7474
TEST(function test_lookup_ipv6_explicit(done) {
7575
const req = dns.lookup('ipv6.google.com', 6,
76-
common.mustCall((err, ip, family) => {
77-
assert.ifError(err);
78-
assert.ok(isIPv6(ip));
79-
assert.strictEqual(family, 6);
76+
common.mustCall((err, ip, family) => {
77+
assert.ifError(err);
78+
assert.ok(isIPv6(ip));
79+
assert.strictEqual(family, 6);
8080

81-
done();
82-
}));
81+
done();
82+
}));
8383

8484
checkWrap(req);
8585
});
@@ -142,13 +142,13 @@ TEST(function test_lookup_ipv6_hint(done) {
142142

143143
TEST(function test_lookup_ip_ipv6(done) {
144144
const req = dns.lookup('::1',
145-
common.mustCall((err, ip, family) => {
146-
assert.ifError(err);
147-
assert.ok(isIPv6(ip));
148-
assert.strictEqual(family, 6);
145+
common.mustCall((err, ip, family) => {
146+
assert.ifError(err);
147+
assert.ok(isIPv6(ip));
148+
assert.strictEqual(family, 6);
149149

150-
done();
151-
}));
150+
done();
151+
}));
152152

153153
checkWrap(req);
154154
});
@@ -169,14 +169,15 @@ TEST(function test_lookup_all_ipv6(done) {
169169
});
170170

171171
done();
172-
}
173-
));
172+
})
173+
);
174174

175175
checkWrap(req);
176176
});
177177

178178
TEST(function test_lookupservice_ip_ipv6(done) {
179-
const req = dns.lookupService('::1', 80,
179+
const req = dns.lookupService(
180+
'::1', 80,
180181
common.mustCall((err, host, service) => {
181182
if (err) {
182183
// Not skipping the test, rather checking an alternative result,
@@ -188,7 +189,8 @@ TEST(function test_lookupservice_ip_ipv6(done) {
188189
assert(host);
189190
assert(['http', 'www', '80'].includes(service));
190191
done();
191-
}));
192+
})
193+
);
192194

193195
checkWrap(req);
194196
});

0 commit comments

Comments
 (0)