lib: chenged anonymous function to arrow function

PR-URL: https://github.com/nodejs/node/pull/24605
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
This commit is contained in:
nakashima 2018-11-24 16:27:50 +09:00 committed by Rich Trott
parent 8344f24581
commit acfcd78892

View File

@ -20,14 +20,14 @@ function writeOut(message) {
}
function onClose(fd) {
return function() {
return () => {
if (fs === null) fs = require('fs');
fs.close(fd, nop);
};
}
function onOpen(cb) {
return function(err, fd) {
return (err, fd) => {
acquiringFd = false;
if (fd !== undefined) {
cachedFd = fd;
@ -41,7 +41,7 @@ function onOpen(cb) {
function onAcquired(message) {
// make a best effort attempt at writing the message
// to the fd. Errors are ignored at this point.
return function(err, fd) {
return (err, fd) => {
if (err)
return writeOut(message);
if (fs === null) fs = require('fs');
@ -70,7 +70,7 @@ function output(message) {
}
function doEmitWarning(warning) {
return function() {
return () => {
process.emit('warning', warning);
};
}
@ -104,7 +104,7 @@ function setupProcessWarnings() {
// process.emitWarning(error)
// process.emitWarning(str[, type[, code]][, ctor])
// process.emitWarning(str[, options])
process.emitWarning = function(warning, type, code, ctor, now) {
process.emitWarning = (warning, type, code, ctor, now) => {
let detail;
if (type !== null && typeof type === 'object' && !Array.isArray(type)) {
ctor = type.ctor;