Skip to content

Commit 7ea64bb

Browse files
committed
syntax sugar and minor changes
1 parent 36082c2 commit 7ea64bb

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/internal/util.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ const colorRegExp = /\u001b\[\d\d?m/g; // eslint-disable-line no-control-regex
5757
let uvBinding;
5858

5959
function lazyUv() {
60-
if (!uvBinding) {
61-
uvBinding = internalBinding('uv');
62-
}
60+
uvBinding ??= internalBinding('uv');
6361
return uvBinding;
6462
}
6563

@@ -297,8 +295,7 @@ function getSystemErrorName(err) {
297295
}
298296

299297
function getSystemErrorMap() {
300-
uvBinding = lazyUv();
301-
return uvBinding.getErrorMap();
298+
return lazyUv().getErrorMap();
302299
}
303300

304301
const kCustomPromisifiedSymbol = SymbolFor('nodejs.util.promisify.custom');

lib/util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ function getSystemErrorName(err) {
245245
}
246246
return internalErrorName(err);
247247
}
248+
248249
// Keep the `exports =` so that various functions can still be monkeypatched
249250
module.exports = {
250251
_errnoException: errnoException,

0 commit comments

Comments
 (0)