From 7c7be517b4a45112fb9fd6b2f519a32dc4449fa7 Mon Sep 17 00:00:00 2001 From: Kajol <114169684+shizuka1308@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:52:09 -0500 Subject: [PATCH] test: replace forEach() with for ... of loop in test-global.js PR-URL: https://github.com/nodejs/node/pull/49772 Reviewed-By: Rafael Gonzaga Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- test/parallel/test-global.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index 0a8fecd240c8a1..d31b1d97744ff8 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -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 = [