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