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 — async_hooks: use validateBoolean for trackPromises · nodejs/node@a2d3f89

File tree

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

‎lib/async_hooks.js‎

Copy file name to clipboardExpand all lines: lib/async_hooks.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ const {
1818
ERR_ASYNC_CALLBACK,
1919
ERR_ASYNC_TYPE,
2020
ERR_INVALID_ASYNC_ID,
21-
ERR_INVALID_ARG_TYPE,
2221
ERR_INVALID_ARG_VALUE,
2322
} = require('internal/errors').codes;
2423
const {
2524
kEmptyObject,
2625
} = require('internal/util');
2726
const {
27+
validateBoolean,
2828
validateFunction,
2929
validateString,
3030
} = require('internal/validators');
@@ -84,8 +84,8 @@ class AsyncHook {
8484
throw new ERR_ASYNC_CALLBACK('hook.destroy');
8585
if (promiseResolve !== undefined && typeof promiseResolve !== 'function')
8686
throw new ERR_ASYNC_CALLBACK('hook.promiseResolve');
87-
if (trackPromises !== undefined && typeof trackPromises !== 'boolean') {
88-
throw new ERR_INVALID_ARG_TYPE('trackPromises', 'boolean', trackPromises);
87+
if (trackPromises !== undefined) {
88+
validateBoolean(trackPromises, 'trackPromises');
8989
}
9090

9191
this[init_symbol] = init;

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.