LibJS+LibWeb: Port interned bytecode strings to UTF-16

This was almost a no-op, except we intern JS exception messages. So the
bulk of this patch is porting exception messages to UTF-16.
This commit is contained in:
Timothy Flynn 2025-08-07 19:31:52 -04:00 committed by Jelle Raaijmakers
commit 70db474cf0
Notes: github-actions[bot] 2025-08-14 08:28:16 +00:00
162 changed files with 1405 additions and 1422 deletions

View file

@ -85,11 +85,11 @@ WebIDL::ExceptionOr<void> NavigateEvent::intercept(NavigationInterceptOptions co
// 2. If this's canIntercept attribute was initialized to false, then throw a "SecurityError" DOMException.
if (!m_can_intercept)
return WebIDL::SecurityError::create(realm, "NavigateEvent cannot be intercepted"_string);
return WebIDL::SecurityError::create(realm, "NavigateEvent cannot be intercepted"_utf16);
// 3. If this's dispatch flag is unset, then throw an "InvalidStateError" DOMException.
if (!this->dispatched())
return WebIDL::InvalidStateError::create(realm, "NavigationEvent is not dispatched yet"_string);
return WebIDL::InvalidStateError::create(realm, "NavigationEvent is not dispatched yet"_utf16);
// 4. Assert: this's interception state is either "none" or "intercepted".
VERIFY(m_interception_state == InterceptionState::None || m_interception_state == InterceptionState::Intercepted);
@ -143,7 +143,7 @@ WebIDL::ExceptionOr<void> NavigateEvent::scroll()
// 2. If this's interception state is not "committed", then throw an "InvalidStateError" DOMException.
if (m_interception_state != InterceptionState::Committed)
return WebIDL::InvalidStateError::create(realm(), "Cannot scroll NavigationEvent that is not committed"_string);
return WebIDL::InvalidStateError::create(realm(), "Cannot scroll NavigationEvent that is not committed"_utf16);
// 3. Process scroll behavior given this.
process_scroll_behavior();
@ -160,15 +160,15 @@ WebIDL::ExceptionOr<void> NavigateEvent::perform_shared_checks()
// then throw an "InvalidStateError" DOMException.
auto& associated_document = as<HTML::Window>(relevant_global_object(*this)).associated_document();
if (!associated_document.is_fully_active())
return WebIDL::InvalidStateError::create(realm(), "Document is not fully active"_string);
return WebIDL::InvalidStateError::create(realm(), "Document is not fully active"_utf16);
// 2. If event's isTrusted attribute was initialized to false, then throw a "SecurityError" DOMException.
if (!this->is_trusted())
return WebIDL::SecurityError::create(realm(), "NavigateEvent is not trusted"_string);
return WebIDL::SecurityError::create(realm(), "NavigateEvent is not trusted"_utf16);
// 3. If event's canceled flag is set, then throw an "InvalidStateError" DOMException.
if (this->cancelled())
return WebIDL::InvalidStateError::create(realm(), "NavigateEvent already cancelled"_string);
return WebIDL::InvalidStateError::create(realm(), "NavigateEvent already cancelled"_utf16);
return {};
}