Skip to content

Commit 8f427eb

Browse files
horihiroBethGriggs
authored andcommitted
lib: convert to arrow function
PR-URL: #24623 Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Masashi Hirano <[email protected]>
1 parent be17cc5 commit 8f427eb

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/internal/child_process.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -62,32 +62,32 @@ const handleConversion = {
6262
'net.Native': {
6363
simultaneousAccepts: true,
6464

65-
send: function(message, handle, options) {
65+
send(message, handle, options) {
6666
return handle;
6767
},
6868

69-
got: function(message, handle, emit) {
69+
got(message, handle, emit) {
7070
emit(handle);
7171
}
7272
},
7373

7474
'net.Server': {
7575
simultaneousAccepts: true,
7676

77-
send: function(message, server, options) {
77+
send(message, server, options) {
7878
return server._handle;
7979
},
8080

81-
got: function(message, handle, emit) {
81+
got(message, handle, emit) {
8282
var server = new net.Server();
83-
server.listen(handle, function() {
83+
server.listen(handle, () => {
8484
emit(server);
8585
});
8686
}
8787
},
8888

8989
'net.Socket': {
90-
send: function(message, socket, options) {
90+
send(message, socket, options) {
9191
if (!socket._handle)
9292
return;
9393

@@ -135,7 +135,7 @@ const handleConversion = {
135135
return handle;
136136
},
137137

138-
postSend: function(message, handle, options, callback, target) {
138+
postSend(message, handle, options, callback, target) {
139139
// Store the handle after successfully sending it, so it can be closed
140140
// when the NODE_HANDLE_ACK is received. If the handle could not be sent,
141141
// just close it.
@@ -153,7 +153,7 @@ const handleConversion = {
153153
}
154154
},
155155

156-
got: function(message, handle, emit) {
156+
got(message, handle, emit) {
157157
var socket = new net.Socket({
158158
handle: handle,
159159
readable: true,
@@ -177,28 +177,28 @@ const handleConversion = {
177177
'dgram.Native': {
178178
simultaneousAccepts: false,
179179

180-
send: function(message, handle, options) {
180+
send(message, handle, options) {
181181
return handle;
182182
},
183183

184-
got: function(message, handle, emit) {
184+
got(message, handle, emit) {
185185
emit(handle);
186186
}
187187
},
188188

189189
'dgram.Socket': {
190190
simultaneousAccepts: false,
191191

192-
send: function(message, socket, options) {
192+
send(message, socket, options) {
193193
message.dgramType = socket.type;
194194

195195
return socket[kStateSymbol].handle;
196196
},
197197

198-
got: function(message, handle, emit) {
198+
got(message, handle, emit) {
199199
var socket = new dgram.Socket(message.dgramType);
200200

201-
socket.bind(handle, function() {
201+
socket.bind(handle, () => {
202202
emit(socket);
203203
});
204204
}
@@ -610,7 +610,7 @@ function setupChannel(target, channel) {
610610
}
611611

612612
// Convert handle object
613-
obj.got.call(this, message, handle, function(handle) {
613+
obj.got.call(this, message, handle, (handle) => {
614614
handleMessage(message.msg, handle, isInternal(message.msg));
615615
});
616616
});
@@ -732,7 +732,7 @@ function setupChannel(target, channel) {
732732
}
733733

734734
if (req.async) {
735-
req.oncomplete = function() {
735+
req.oncomplete = () => {
736736
control.unref();
737737
if (typeof callback === 'function')
738738
callback(null);
@@ -869,7 +869,7 @@ function _validateStdio(stdio, sync) {
869869

870870
// Translate stdio into C++-readable form
871871
// (i.e. PipeWraps or fds)
872-
stdio = stdio.reduce(function(acc, stdio, i) {
872+
stdio = stdio.reduce((acc, stdio, i) => {
873873
function cleanup() {
874874
for (var i = 0; i < acc.length; i++) {
875875
if ((acc[i].type === 'pipe' || acc[i].type === 'ipc') && acc[i].handle)

0 commit comments

Comments
 (0)