test: replace forEach() with for...of in parallel tests - #65272
Open
pmarkert wants to merge 1 commit into
Open
Conversation
Replace `Array.prototype.forEach()` with `for...of` loops across 17 tests in `test/parallel`, so each loop body reads as a plain statement rather than an arrow callback. None of the iterated values are sparse arrays, the one case where `forEach` and `for...of` genuinely differ, so both constructs visit the same elements in the same order. No callback relied on `this`, an early return, or async behaviour, and the number of assertions run in each file is unchanged. Signed-off-by: Phillip Markert <phillip@ephisys.com>
jasnell
approved these changes
Aug 13, 2026
Collaborator
Member
|
Awesome! This passed CI and will be ready to land. If there's another sign off, it can land after 48 hours of opening. If no one else signs off, then it will be one week. But otherwise, it is ready to go. Thank you for participating in the code and learn! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test: replace
forEach()withfor...ofin parallel testsReplace
Array.prototype.forEach()withfor...ofloops across 17tests in
test/parallel, so each loop body reads as a plain statementrather than an arrow callback.
None of the iterated values are sparse arrays, the one case where
forEachandfor...ofgenuinely differ, so both constructs visit thesame elements in the same order. No callback relied on
this, an earlyreturn, or async behaviour, and the number of assertions run in each
file is unchanged.