Skip to content

Commit 1c4bc86

Browse files
kojiGit55targos
authored andcommittedNov 29, 2018
lib: chenged anonymous function to arrow function
PR-URL: #24605 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
1 parent 053f3d6 commit 1c4bc86

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎lib/internal/process/warning.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ function writeOut(message) {
2020
}
2121

2222
function onClose(fd) {
23-
return function() {
23+
return () => {
2424
if (fs === null) fs = require('fs');
2525
fs.close(fd, nop);
2626
};
2727
}
2828

2929
function onOpen(cb) {
30-
return function(err, fd) {
30+
return (err, fd) => {
3131
acquiringFd = false;
3232
if (fd !== undefined) {
3333
cachedFd = fd;
@@ -41,7 +41,7 @@ function onOpen(cb) {
4141
function onAcquired(message) {
4242
// make a best effort attempt at writing the message
4343
// to the fd. Errors are ignored at this point.
44-
return function(err, fd) {
44+
return (err, fd) => {
4545
if (err)
4646
return writeOut(message);
4747
if (fs === null) fs = require('fs');
@@ -70,7 +70,7 @@ function output(message) {
7070
}
7171

7272
function doEmitWarning(warning) {
73-
return function() {
73+
return () => {
7474
process.emit('warning', warning);
7575
};
7676
}
@@ -104,7 +104,7 @@ function setupProcessWarnings() {
104104
// process.emitWarning(error)
105105
// process.emitWarning(str[, type[, code]][, ctor])
106106
// process.emitWarning(str[, options])
107-
process.emitWarning = function(warning, type, code, ctor, now) {
107+
process.emitWarning = (warning, type, code, ctor, now) => {
108108
let detail;
109109
if (type !== null && typeof type === 'object' && !Array.isArray(type)) {
110110
ctor = type.ctor;

0 commit comments

Comments
 (0)