GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — util: skip type checks in internal getSystemErrorName · nodejs/node@8e31bf4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • internal
      • util.js
    • util.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/util.js‎

Copy file name to clipboardExpand all lines: lib/internal/util.js
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ function getConstructorOf(obj) {
208208
}
209209

210210
function getSystemErrorName(err) {
211-
if (typeof err !== 'number' || err >= 0 || !Number.isSafeInteger(err)) {
212-
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'err',
213-
'negative number');
214-
}
215-
216211
const entry = errmap.get(err);
217212
return entry ? entry[0] : `Unknown system error ${err}`;
218213
}
Collapse file

‎lib/util.js‎

Copy file name to clipboardExpand all lines: lib/util.js
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const {
5454
customInspectSymbol,
5555
deprecate,
5656
getConstructorOf,
57-
getSystemErrorName,
57+
getSystemErrorName: internalErrorName,
5858
isError,
5959
promisify,
6060
join,
@@ -1071,6 +1071,14 @@ function callbackify(original) {
10711071
return callbackified;
10721072
}
10731073

1074+
function getSystemErrorName(err) {
1075+
if (typeof err !== 'number' || err >= 0 || !Number.isSafeInteger(err)) {
1076+
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'err',
1077+
'negative number');
1078+
}
1079+
return internalErrorName(err);
1080+
}
1081+
10741082
// Keep the `exports =` so that various functions can still be monkeypatched
10751083
module.exports = exports = {
10761084
_errnoException,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.