Skip to content

worker: make MessagePort constructor non-callable

Refactor the C++ code for creating MessagePorts to skip calling the constructor and instead directly instantiating the InstanceTemplate, and always throw an error from the MessagePort constructor.

This aligns behaviour with the web, and creating single MessagePorts does not make sense anyway.

This is technically a breaking change and I’d be happy to split out the added throw into a separate PR out of caution, if anybody considers that a good idea.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading