LibWeb: Implement Worker.postMessage(message, transfer)

This commit is contained in:
Shannon Booth 2024-10-29 01:10:30 +13:00 committed by Andreas Kling
parent 755b63132b
commit bf81e2fd64
Notes: github-actions[bot] 2024-10-28 22:33:09 +00:00
3 changed files with 12 additions and 2 deletions

View file

@ -132,6 +132,16 @@ WebIDL::ExceptionOr<void> Worker::post_message(JS::Value message, StructuredSeri
return m_outside_port->post_message(message, options);
}
// https://html.spec.whatwg.org/multipage/workers.html#dom-worker-postmessage
WebIDL::ExceptionOr<void> Worker::post_message(JS::Value message, Vector<JS::Handle<JS::Object>> const& transfer)
{
// The postMessage(message, transfer) and postMessage(message, options) methods on Worker objects act as if,
// when invoked, they immediately invoked the respective postMessage(message, transfer) and
// postMessage(message, options) on the port, with the same arguments, and returned the same return value.
return m_outside_port->post_message(message, transfer);
}
#undef __ENUMERATE
#define __ENUMERATE(attribute_name, event_name) \
void Worker::set_##attribute_name(WebIDL::CallbackType* value) \