From 8296dd995562a0233dcc75d4f59621f60dd0c77d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 5 Apr 2022 12:53:58 +0100 Subject: [PATCH] WebContent: Use ConsoleGlobalObject for the console's global object :^) Seems like this got missed when ESOs were implemented. Now we can use `$0` again! --- Userland/Services/WebContent/WebContentConsoleClient.cpp | 2 +- Userland/Services/WebContent/WebContentConsoleClient.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Services/WebContent/WebContentConsoleClient.cpp b/Userland/Services/WebContent/WebContentConsoleClient.cpp index fb742e9a38..1b245b6918 100644 --- a/Userland/Services/WebContent/WebContentConsoleClient.cpp +++ b/Userland/Services/WebContent/WebContentConsoleClient.cpp @@ -35,7 +35,7 @@ WebContentConsoleClient::WebContentConsoleClient(JS::Console& console, WeakPtrinitialize_global_object(); vm.pop_execution_context(); - m_console_global_object = JS::make_handle(console_global_object); + m_interpreter->realm().set_global_object(*console_global_object); } void WebContentConsoleClient::handle_input(String const& js_source) diff --git a/Userland/Services/WebContent/WebContentConsoleClient.h b/Userland/Services/WebContent/WebContentConsoleClient.h index 9456750d55..5ece72e9fb 100644 --- a/Userland/Services/WebContent/WebContentConsoleClient.h +++ b/Userland/Services/WebContent/WebContentConsoleClient.h @@ -29,7 +29,6 @@ private: ConnectionFromClient& m_client; WeakPtr m_interpreter; - JS::Handle m_console_global_object; void clear_output(); void print_html(String const& line);