Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 05a16e7

Browse filesBrowse files
aduh95danielleadams
authored andcommitted
worker: refactor to avoid unsafe array iteration
PR-URL: #37346 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6d53e79 commit 05a16e7
Copy full SHA for 05a16e7

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎lib/internal/main/worker_thread.js‎

Copy file name to clipboardExpand all lines: lib/internal/main/worker_thread.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
const {
77
ArrayPrototypeConcat,
8+
ArrayPrototypeForEach,
89
ArrayPrototypeSplice,
910
ObjectDefineProperty,
1011
PromisePrototypeCatch,
@@ -178,8 +179,9 @@ port.on('message', (message) => {
178179
}
179180
} else if (message.type === STDIO_PAYLOAD) {
180181
const { stream, chunks } = message;
181-
for (const { chunk, encoding } of chunks)
182+
ArrayPrototypeForEach(chunks, ({ chunk, encoding }) => {
182183
process[stream].push(chunk, encoding);
184+
});
183185
} else {
184186
assert(
185187
message.type === STDIO_WANTS_MORE_DATA,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.