deno
bc5b1816 - fix(ext/web,runtime): match MessagePort by host-object brand

Commit
64 days ago
fix(ext/web,runtime): match MessagePort by host-object brand The MessagePort rewrite installed a "MessagePort" transferable receive callback in node:worker_threads that returns Node-style instances (different prototype, same hostObjectBrand). Three sites still filtered `MessageEvent.ports` by the Web MessagePort prototype and so dropped Node-style ports on the floor: - runtime/js/99_main.js dispatchWorkerMessage - runtime/js/11_workers.js Worker#dispatchMessage - ext/web/13_message_port.js dispatchPortMessageData That broke tests/unit/worker_test.ts "Send MessagePorts from / to workers" -- `ev.ports[0]` was undefined. Switch all three to a brand check so either prototype carries through MessageEvent.ports as expected.
Author
Parents
Loading