summaryrefslogtreecommitdiff
path: root/lib/internal/worker/io.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-01-02 16:07:20 +0100
committerAnna Henningsen <anna@addaleax.net>2019-01-04 19:27:38 +0100
commit9dfbc391fafe0495d30512ab811d4e372f9be449 (patch)
treeb57c6608b997f6ae5da978b3afa9efeabe6fca1f /lib/internal/worker/io.js
parentb22c86ed3bd3242177b02a34292febe41275a52b (diff)
downloadandroid-node-v8-9dfbc391fafe0495d30512ab811d4e372f9be449.tar.gz
android-node-v8-9dfbc391fafe0495d30512ab811d4e372f9be449.tar.bz2
android-node-v8-9dfbc391fafe0495d30512ab811d4e372f9be449.zip
worker: improve JS-side debugging
Do not print debug messages that indicate that a stdio stream has drained; because `util.debuglog()` uses `console.log`, which in turn uses stdio streams, this would otherwise have lead to an endless loop. PR-URL: https://github.com/nodejs/node/pull/25312 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/worker/io.js')
-rw-r--r--lib/internal/worker/io.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js
index d249ba8508..ad8056b5b9 100644
--- a/lib/internal/worker/io.js
+++ b/lib/internal/worker/io.js
@@ -62,7 +62,8 @@ MessagePort.prototype.unref = MessagePortPrototype.unref;
// .onmessage events, and a function used for sending data to a MessagePort
// in some other thread.
MessagePort.prototype[kOnMessageListener] = function onmessage(payload) {
- debug(`[${threadId}] received message`, payload);
+ if (payload.type !== messageTypes.STDIO_WANTS_MORE_DATA)
+ debug(`[${threadId}] received message`, payload);
// Emit the deserialized object to userland.
this.emit('message', payload);
};