From b2ba91123bb60dcbc288ee78685aa2cc02bb7b06 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 25 Sep 2022 19:05:45 -0600 Subject: [PATCH] Ladybird/ConsoleClient: Get the current ESO from new HostDefined helper --- Ladybird/ConsoleClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ladybird/ConsoleClient.cpp b/Ladybird/ConsoleClient.cpp index 36cc43fda0..e41cac1ca7 100644 --- a/Ladybird/ConsoleClient.cpp +++ b/Ladybird/ConsoleClient.cpp @@ -32,7 +32,7 @@ ConsoleClient::ConsoleClient(JS::Console& console, JS::Realm& realm, SimpleWebVi // NOTE: We need to push an execution context here for NativeFunction::create() to succeed during global object initialization. // It gets removed immediately after creating the interpreter in Document::interpreter(). - auto& eso = verify_cast(*realm.host_defined()); + auto& eso = Web::Bindings::host_defined_environment_settings_object(realm); vm.push_execution_context(eso.realm_execution_context()); console_global_object->initialize(realm); vm.pop_execution_context(); @@ -45,7 +45,7 @@ void ConsoleClient::handle_input(String const& js_source) if (!m_realm) return; - auto& settings = verify_cast(*m_realm->host_defined()); + auto& settings = Web::Bindings::host_defined_environment_settings_object(*m_realm); auto script = Web::HTML::ClassicScript::create("(console)", js_source, settings, settings.api_base_url()); // FIXME: Add parse error printouts back once ClassicScript can report parse errors.