test: replace forEach() with for ... of loop in test-global.js

PR-URL: https://github.com/nodejs/node/pull/49772
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Kajol authored and Ulises Gascón committed 2023-12-11 11:12:51 +00:00
1 parent 4b219b6ece
commit 7cacddfcc1
1 file changed
+2 -2
+2 -2
View File
@@ -30,7 +30,7 @@ const assert = require('assert');
const { builtinModules } = require('module');
// Load all modules to actually cover most code parts.
builtinModules.forEach((moduleName) => {
for (const moduleName of builtinModules) {
if (!moduleName.includes('/')) {
try {
// This could throw for e.g., crypto if the binary is not compiled
@@ -40,7 +40,7 @@ builtinModules.forEach((moduleName) => {
// Continue regardless of error.
}
}
});
}
{
const expected = [