Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17abc8c

Browse filesBrowse files
Trotttargos
authored andcommitted
test: favor arrow functions for anonymous callbacks
In test-https-agent-additional-options, use arrow functions for anonymous callbacks. Replace a use of `this` with the relevant constant. PR-URL: #27830 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 155b947 commit 17abc8c
Copy full SHA for 17abc8c

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-https-agent-additional-options.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-https-agent-additional-options.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const options = {
1515
minVersion: 'TLSv1.1',
1616
};
1717

18-
const server = https.Server(options, function(req, res) {
18+
const server = https.Server(options, (req, res) => {
1919
res.writeHead(200);
2020
res.end('hello world\n');
2121
});
@@ -45,9 +45,9 @@ function variations(iter, port, cb) {
4545
return common.mustCall(cb);
4646
} else {
4747
const [key, val] = value;
48-
return common.mustCall(function(res) {
48+
return common.mustCall((res) => {
4949
res.resume();
50-
https.globalAgent.once('free', common.mustCall(function() {
50+
https.globalAgent.once('free', common.mustCall(() => {
5151
https.get(
5252
Object.assign({}, getBaseOptions(port), { [key]: val }),
5353
variations(iter, port, cb)
@@ -57,16 +57,16 @@ function variations(iter, port, cb) {
5757
}
5858
}
5959

60-
server.listen(0, common.mustCall(function() {
61-
const port = this.address().port;
60+
server.listen(0, common.mustCall(() => {
61+
const port = server.address().port;
6262
const globalAgent = https.globalAgent;
6363
globalAgent.keepAlive = true;
6464
https.get(getBaseOptions(port), variations(
6565
updatedValues.entries(),
6666
port,
67-
common.mustCall(function(res) {
67+
common.mustCall((res) => {
6868
res.resume();
69-
globalAgent.once('free', common.mustCall(function() {
69+
globalAgent.once('free', common.mustCall(() => {
7070
// Verify that different keep-alived connections are created
7171
// for the base call and each variation
7272
const keys = Object.keys(globalAgent.freeSockets);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.