Skip to content
Prev Previous commit
Next Next commit
fixup! lib: make safe primordials safe to iterate
  • Loading branch information
aduh95 committed Dec 12, 2020
commit 036ff05bfeefbb1ba02b9aefd35c0964260104d5
4 changes: 2 additions & 2 deletions lib/internal/worker/io.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {
ArrayPrototypeForEach,
ArrayPrototypeMap,
ArrayPrototypePush,
FunctionPrototypeCall,
Expand Down Expand Up @@ -314,8 +315,7 @@ class WritableWorkerStdio extends Writable {
[kStdioWantsMoreDataCallback]() {
const cbs = this[kWritableCallbacks];
this[kWritableCallbacks] = [];
for (const cb of cbs)
cb();
ArrayPrototypeForEach(cbs, FunctionPrototypeCall);
if ((this[kPort][kWaitingStreams] -= cbs.length) === 0)
this[kPort].unref();
}
Expand Down