util: named anonymous functions

PR-URL: https://github.com/nodejs/node/pull/20408
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
This commit is contained in:
Carrie Coxwell 2018-04-29 13:29:40 -05:00 committed by Matheus Marchini
parent a00f76c360
commit 4d8806fc40
No known key found for this signature in database
GPG Key ID: BE516BA4874DB4D9

View File

@ -276,12 +276,12 @@ function debuglog(set) {
if (!debugs[set]) {
if (debugEnvRegex.test(set)) {
const pid = process.pid;
debugs[set] = function() {
debugs[set] = function debug() {
const msg = exports.format.apply(exports, arguments);
console.error('%s %d: %s', set, pid, msg);
};
} else {
debugs[set] = function() {};
debugs[set] = function debug() {};
}
}
return debugs[set];