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>
This commit is contained in:
parent
b22c86ed3b
commit
9dfbc391fa
@ -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);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user