Skip to content

Commit b30b645

Browse files
horihirorefack
authored andcommitted
lib: convert to arrow function
PR-URL: nodejs#24623 Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Masashi Hirano <[email protected]>
1 parent 146388b commit b30b645

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/internal/child_process.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,32 @@ const handleConversion = {
6868
'net.Native': {
6969
simultaneousAccepts: true,
7070

71-
send: function(message, handle, options) {
71+
send(message, handle, options) {
7272
return handle;
7373
},
7474

75-
got: function(message, handle, emit) {
75+
got(message, handle, emit) {
7676
emit(handle);
7777
}
7878
},
7979

8080
'net.Server': {
8181
simultaneousAccepts: true,
8282

83-
send: function(message, server, options) {
83+
send(message, server, options) {
8484
return server._handle;
8585
},
8686

87-
got: function(message, handle, emit) {
87+
got(message, handle, emit) {
8888
var server = new net.Server();
89-
server.listen(handle, function() {
89+
server.listen(handle, () => {
9090
emit(server);
9191
});
9292
}
9393
},
9494

9595
'net.Socket': {
96-
send: function(message, socket, options) {
96+
send(message, socket, options) {
9797
if (!socket._handle)
9898
return;
9999

@@ -141,7 +141,7 @@ const handleConversion = {
141141
return handle;
142142
},
143143

144-
postSend: function(message, handle, options, callback, target) {
144+
postSend(message, handle, options, callback, target) {
145145
// Store the handle after successfully sending it, so it can be closed
146146
// when the NODE_HANDLE_ACK is received. If the handle could not be sent,
147147
// just close it.
@@ -159,7 +159,7 @@ const handleConversion = {
159159
}
160160
},
161161

162-
got: function(message, handle, emit) {
162+
got(message, handle, emit) {
163163
var socket = new net.Socket({
164164
handle: handle,
165165
readable: true,
@@ -183,28 +183,28 @@ const handleConversion = {
183183
'dgram.Native': {
184184
simultaneousAccepts: false,
185185

186-
send: function(message, handle, options) {
186+
send(message, handle, options) {
187187
return handle;
188188
},
189189

190-
got: function(message, handle, emit) {
190+
got(message, handle, emit) {
191191
emit(handle);
192192
}
193193
},
194194

195195
'dgram.Socket': {
196196
simultaneousAccepts: false,
197197

198-
send: function(message, socket, options) {
198+
send(message, socket, options) {
199199
message.dgramType = socket.type;
200200

201201
return socket[kStateSymbol].handle;
202202
},
203203

204-
got: function(message, handle, emit) {
204+
got(message, handle, emit) {
205205
var socket = new dgram.Socket(message.dgramType);
206206

207-
socket.bind(handle, function() {
207+
socket.bind(handle, () => {
208208
emit(socket);
209209
});
210210
}
@@ -617,7 +617,7 @@ function setupChannel(target, channel) {
617617
}
618618

619619
// Convert handle object
620-
obj.got.call(this, message, handle, function(handle) {
620+
obj.got.call(this, message, handle, (handle) => {
621621
handleMessage(message.msg, handle, isInternal(message.msg));
622622
});
623623
});
@@ -739,7 +739,7 @@ function setupChannel(target, channel) {
739739
}
740740

741741
if (wasAsyncWrite) {
742-
req.oncomplete = function() {
742+
req.oncomplete = () => {
743743
control.unref();
744744
if (typeof callback === 'function')
745745
callback(null);
@@ -876,7 +876,7 @@ function _validateStdio(stdio, sync) {
876876

877877
// Translate stdio into C++-readable form
878878
// (i.e. PipeWraps or fds)
879-
stdio = stdio.reduce(function(acc, stdio, i) {
879+
stdio = stdio.reduce((acc, stdio, i) => {
880880
function cleanup() {
881881
for (var i = 0; i < acc.length; i++) {
882882
if ((acc[i].type === 'pipe' || acc[i].type === 'ipc') && acc[i].handle)

0 commit comments

Comments
 (0)