Skip to content

Commit c5110bf

Browse files
authored
Fix conflict caused by global onmessages handler in worker.js (#17850)
Mirrors the fix from #16450 which solves the issue for library_pthread.js to fix worker.js as well. Fixes #17844
1 parent 4e9ba14 commit c5110bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/worker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,10 @@ self.onmessage = (e) => {
284284
// Defer executing this queue until the runtime is initialized.
285285
pendingNotifiedProxyingQueues.push(e.data.queue);
286286
}
287-
} else {
287+
} else if (e.data.cmd) {
288+
// The received message looks like something that should be handled by this message
289+
// handler, (since there is a e.data.cmd field present), but is not one of the
290+
// recognized commands:
288291
err('worker.js received unknown command ' + e.data.cmd);
289292
err(e.data);
290293
}

0 commit comments

Comments
 (0)