Skip to content

Commit

Permalink
Fix ERR_INVALID_ARG_TYPE on Node.js nightly (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Jan 31, 2021
1 parent 3f9ccc7 commit e2ecc00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/WorkerHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,9 @@ function WorkerHandler(script, _options) {
// send all queued requests to worker
function dispatchQueuedRequests()
{
me.requestQueue.forEach(me.worker.send.bind(me.worker));
me.requestQueue = [];
for(const request of me.requestQueue.splice(0)) {
me.worker.send(request);
}
}

var worker = this.worker;
Expand Down

0 comments on commit e2ecc00

Please sign in to comment.