Skip to content

Commit

Permalink
syntax sugar and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eladkishon committed Apr 7, 2021
1 parent 36082c2 commit 7ea64bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/internal/util.js
Expand Up @@ -57,9 +57,7 @@ const colorRegExp = /\u001b\[\d\d?m/g; // eslint-disable-line no-control-regex
let uvBinding;

function lazyUv() {
if (!uvBinding) {
uvBinding = internalBinding('uv');
}
uvBinding ??= internalBinding('uv');
return uvBinding;
}

Expand Down Expand Up @@ -297,8 +295,7 @@ function getSystemErrorName(err) {
}

function getSystemErrorMap() {
uvBinding = lazyUv();
return uvBinding.getErrorMap();
return lazyUv().getErrorMap();
}

const kCustomPromisifiedSymbol = SymbolFor('nodejs.util.promisify.custom');
Expand Down
1 change: 1 addition & 0 deletions lib/util.js
Expand Up @@ -245,6 +245,7 @@ function getSystemErrorName(err) {
}
return internalErrorName(err);
}

// Keep the `exports =` so that various functions can still be monkeypatched
module.exports = {
_errnoException: errnoException,
Expand Down

0 comments on commit 7ea64bb

Please sign in to comment.