Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: replace anonymous closure functions with arrow functions #24443

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/parallel/test-http-localaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ if (!common.hasMultiLocalhost())
const http = require('http');
const assert = require('assert');

const server = http.createServer(function(req, res) {
const server = http.createServer((req, res) => {
console.log(`Connect from: ${req.connection.remoteAddress}`);
assert.strictEqual(req.connection.remoteAddress, '127.0.0.2');

req.on('end', function() {
req.on('end', () => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(`You are from: ${req.connection.remoteAddress}`);
});
req.resume();
});

server.listen(0, '127.0.0.1', function() {
server.listen(0, '127.0.0.1', () => {
const options = { host: 'localhost',
port: this.address().port,
port: server.address().port,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tpanthera - once more issue here - you put one extra space in line 44 before the code. Align it to the previous line, and I guess we are all good here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for correcting, committed the revised code.

path: '/',
method: 'GET',
localAddress: '127.0.0.2' };

const req = http.request(options, function(res) {
res.on('end', function() {
res.on('end', () => {
server.close();
process.exit();
});
Expand Down