Skip to content

Commit f718483

Browse files
authored
Don't redirect dbg to threadPrintErr (#23879)
The redirection to node's stderr is already part of `dbg` so there is no need to redirect it here. Also, we don't necessarily want to send dbg message to console.error. Fixes: #23860
1 parent bf468eb commit f718483

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/runtime_pthread.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,14 @@ if (ENVIRONMENT_IS_PTHREAD) {
3838
var initializedJS = false;
3939

4040
function threadPrintErr(...args) {
41-
var text = args.join(' ');
4241
#if ENVIRONMENT_MAY_BE_NODE
4342
// See https://github.com/emscripten-core/emscripten/issues/14804
4443
if (ENVIRONMENT_IS_NODE) {
45-
fs.writeSync(2, text + '\n');
44+
fs.writeSync(2, args.join(' ') + '\n');
4645
return;
4746
}
4847
#endif
49-
console.error(text);
48+
console.error(...args);
5049
}
5150

5251
#if LOAD_SOURCE_MAP || USE_OFFSET_CONVERTER
@@ -65,9 +64,6 @@ if (ENVIRONMENT_IS_PTHREAD) {
6564
if (!Module['printErr'])
6665
#endif
6766
err = threadPrintErr;
68-
#if ASSERTIONS || RUNTIME_DEBUG
69-
dbg = threadPrintErr;
70-
#endif
7167
function threadAlert(...args) {
7268
var text = args.join(' ');
7369
postMessage({cmd: 'alert', text, threadId: _pthread_self()});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4113
1+
4108
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8551
1+
8550

0 commit comments

Comments
 (0)