From 5bba0e63218ba9469eec62c1101bc6149d789116 Mon Sep 17 00:00:00 2001 From: nakashima Date: Sat, 24 Nov 2018 16:27:50 +0900 Subject: [PATCH] lib: chenged anonymous function to arrow function --- lib/internal/process/warning.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index 131d479474f248..637b9ffb54b406 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -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;