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 — test: replace forEach() with for .. of · nodejs/node@7b9b1fb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-async-wrap-constructor.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-async-wrap-constructor.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-async-wrap-constructor.js
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ require('../common');
66
const assert = require('assert');
77
const async_hooks = require('async_hooks');
88

9-
[0, 1, false, true, null, 'hello'].forEach((badArg) => {
9+
const falsyValues = [0, 1, false, true, null, 'hello'];
10+
for (const badArg of falsyValues) {
1011
const hookNames = ['init', 'before', 'after', 'destroy', 'promiseResolve'];
11-
hookNames.forEach((field) => {
12+
for (const hookName of hookNames) {
1213
assert.throws(() => {
13-
async_hooks.createHook({ [field]: badArg });
14+
async_hooks.createHook({ [hookName]: badArg });
1415
}, {
1516
code: 'ERR_ASYNC_CALLBACK',
1617
name: 'TypeError',
17-
message: `hook.${field} must be a function`
18+
message: `hook.${hookName} must be a function`
1819
});
19-
});
20-
});
20+
}
21+
}

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.