Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: chenged anonymous function to arrow function #24605

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/internal/process/warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
Expand Down Expand Up @@ -70,7 +70,7 @@ function output(message) {
}

function doEmitWarning(warning) {
return function() {
return () => {
process.emit('warning', warning);
};
}
Expand Down Expand Up @@ -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;
Expand Down