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 — fs: don't hard code name in validatePosition() · nodejs/node@dc6379b

File tree

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

‎lib/internal/fs/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/utils.js
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -906,17 +906,15 @@ const validatePrimitiveStringAfterArrayBufferView = hideStackFrames((buffer, nam
906906

907907
const validatePosition = hideStackFrames((position, name) => {
908908
if (typeof position === 'number') {
909-
validateInteger(position, 'position');
909+
validateInteger(position, name);
910910
} else if (typeof position === 'bigint') {
911911
if (!(position >= -(2n ** 63n) && position <= 2n ** 63n - 1n)) {
912-
throw new ERR_OUT_OF_RANGE('position',
912+
throw new ERR_OUT_OF_RANGE(name,
913913
`>= ${-(2n ** 63n)} && <= ${2n ** 63n - 1n}`,
914914
position);
915915
}
916916
} else {
917-
throw new ERR_INVALID_ARG_TYPE('position',
918-
['integer', 'bigint'],
919-
position);
917+
throw new ERR_INVALID_ARG_TYPE(name, ['integer', 'bigint'], position);
920918
}
921919
});
922920

0 commit comments

Comments
0 (0)
You are visitor 01402503 — 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.