From d9db6bec42783ed0b1cacb605575a8e4884dc904 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Mon, 6 Jul 2020 16:57:22 -0700 Subject: LibJS: Move global symbol map from SymbolObject to Interpreter This allows different instances of the Interpreter to have their own global symbols. Also makes Symbol non-copyable and non-moveable. --- Libraries/LibJS/Interpreter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Libraries/LibJS/Interpreter.h') diff --git a/Libraries/LibJS/Interpreter.h b/Libraries/LibJS/Interpreter.h index 950b40aa3b..442759af30 100644 --- a/Libraries/LibJS/Interpreter.h +++ b/Libraries/LibJS/Interpreter.h @@ -111,6 +111,10 @@ public: Reference get_reference(const FlyString& name); + Symbol* get_global_symbol(const String& description); + Symbol* get_well_known_symbol(const String& description) const; + const HashMap& get_well_known_symbol_map(Badge) const { return m_well_known_symbol_map; }; + void gather_roots(Badge, HashTable&); void enter_scope(const ScopeNode&, ArgumentVector, ScopeType, GlobalObject&); @@ -217,6 +221,9 @@ private: Object* m_global_object { nullptr }; + HashMap m_well_known_symbol_map; + HashMap m_global_symbol_map; + Exception* m_exception { nullptr }; ScopeType m_unwind_until { ScopeType::None }; -- cgit v1.2.3