1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibWeb: Port CloseEvent to new String

This commit is contained in:
Kenneth Myhra 2023-03-05 09:54:17 +01:00 committed by Linus Groh
parent d0f904dd4c
commit e661f03ffa
4 changed files with 14 additions and 13 deletions

View file

@ -221,8 +221,8 @@ void WebSocket::on_close(u16 code, DeprecatedString reason, bool was_clean)
HTML::CloseEventInit event_init {};
event_init.was_clean = was_clean;
event_init.code = code;
event_init.reason = move(reason);
dispatch_event(HTML::CloseEvent::create(realm(), HTML::EventNames::close, event_init).release_value_but_fixme_should_propagate_errors());
event_init.reason = String::from_deprecated_string(reason).release_value_but_fixme_should_propagate_errors();
dispatch_event(HTML::CloseEvent::create(realm(), String::from_deprecated_string(HTML::EventNames::close.view()).release_value_but_fixme_should_propagate_errors(), event_init).release_value_but_fixme_should_propagate_errors());
}
// https://websockets.spec.whatwg.org/#feedback-from-the-protocol