diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index 2c6902b5d7462a..3528ebccfdba35 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -5,6 +5,7 @@ const { ArrayPrototypeConcat, + ArrayPrototypeForEach, ArrayPrototypeSplice, ObjectDefineProperty, PromisePrototypeCatch, @@ -181,8 +182,9 @@ port.on('message', (message) => { } } else if (message.type === STDIO_PAYLOAD) { const { stream, chunks } = message; - for (const { chunk, encoding } of chunks) + ArrayPrototypeForEach(chunks, ({ chunk, encoding }) => { process[stream].push(chunk, encoding); + }); } else { assert( message.type === STDIO_WANTS_MORE_DATA,