فهرست منبع

LibWeb: Remove Document::interpreter()

Nobody needs this anymore, so we can finally remove it. :^)
Andreas Kling 2 سال پیش
والد
کامیت
4c887bf6c3

+ 0 - 8
Userland/Libraries/LibWeb/DOM/Document.cpp

@@ -1047,14 +1047,6 @@ HTML::EnvironmentSettingsObject& Document::relevant_settings_object()
     return verify_cast<HTML::EnvironmentSettingsObject>(*realm().host_defined());
     return verify_cast<HTML::EnvironmentSettingsObject>(*realm().host_defined());
 }
 }
 
 
-JS::Interpreter& Document::interpreter()
-{
-    if (!m_interpreter) {
-        m_interpreter = JS::Interpreter::create_with_existing_realm(realm());
-    }
-    return *m_interpreter;
-}
-
 JS::Value Document::run_javascript(StringView source, StringView filename)
 JS::Value Document::run_javascript(StringView source, StringView filename)
 {
 {
     // FIXME: The only user of this function now is javascript: URLs. Refactor them to follow the spec: https://html.spec.whatwg.org/multipage/browsing-the-web.html#javascript-protocol
     // FIXME: The only user of this function now is javascript: URLs. Refactor them to follow the spec: https://html.spec.whatwg.org/multipage/browsing-the-web.html#javascript-protocol

+ 0 - 3
Userland/Libraries/LibWeb/DOM/Document.h

@@ -188,7 +188,6 @@ public:
     void set_source(String const& source) { m_source = source; }
     void set_source(String const& source) { m_source = source; }
 
 
     HTML::EnvironmentSettingsObject& relevant_settings_object();
     HTML::EnvironmentSettingsObject& relevant_settings_object();
-    JS::Interpreter& interpreter();
 
 
     JS::Value run_javascript(StringView source, StringView filename = "(unknown)"sv);
     JS::Value run_javascript(StringView source, StringView filename = "(unknown)"sv);
 
 
@@ -395,8 +394,6 @@ private:
 
 
     String m_source;
     String m_source;
 
 
-    OwnPtr<JS::Interpreter> m_interpreter;
-
     JS::GCPtr<HTML::HTMLScriptElement> m_pending_parsing_blocking_script;
     JS::GCPtr<HTML::HTMLScriptElement> m_pending_parsing_blocking_script;
     Vector<JS::Handle<HTML::HTMLScriptElement>> m_scripts_to_execute_when_parsing_has_finished;
     Vector<JS::Handle<HTML::HTMLScriptElement>> m_scripts_to_execute_when_parsing_has_finished;
     Vector<JS::Handle<HTML::HTMLScriptElement>> m_scripts_to_execute_as_soon_as_possible;
     Vector<JS::Handle<HTML::HTMLScriptElement>> m_scripts_to_execute_as_soon_as_possible;

+ 0 - 1
Userland/Services/WebContent/WebContentConsoleClient.cpp

@@ -29,7 +29,6 @@ WebContentConsoleClient::WebContentConsoleClient(JS::Console& console, JS::Realm
     auto console_global_object = realm.heap().allocate_without_realm<ConsoleGlobalObject>(realm, window);
     auto console_global_object = realm.heap().allocate_without_realm<ConsoleGlobalObject>(realm, window);
 
 
     // NOTE: We need to push an execution context here for NativeFunction::create() to succeed during global object initialization.
     // 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<Web::HTML::EnvironmentSettingsObject>(*realm.host_defined());
     auto& eso = verify_cast<Web::HTML::EnvironmentSettingsObject>(*realm.host_defined());
     vm.push_execution_context(eso.realm_execution_context());
     vm.push_execution_context(eso.realm_execution_context());
     console_global_object->initialize(realm);
     console_global_object->initialize(realm);