mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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:
1 parent
4b219b6ece
commit
7cacddfcc1
1 file changed
+2
-2
@@ -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 = [
|
||||
|
||||
Reference in new issue
Block a user