Browse Source

LibJS: Add const/non-const VM::global_symbol_registry() getters

This will allow us to replace the strange get_global_symbol() API that
creates symbols on the fly when not found.
Linus Groh 2 years ago
parent
commit
b821356ba6
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Userland/Libraries/LibJS/Runtime/VM.h

+ 3 - 0
Userland/Libraries/LibJS/Runtime/VM.h

@@ -168,6 +168,9 @@ public:
 
 
     StackInfo const& stack_info() const { return m_stack_info; };
     StackInfo const& stack_info() const { return m_stack_info; };
 
 
+    HashMap<DeprecatedString, NonnullGCPtr<Symbol>> const& global_symbol_registry() const { return m_global_symbol_registry; }
+    HashMap<DeprecatedString, NonnullGCPtr<Symbol>>& global_symbol_registry() { return m_global_symbol_registry; }
+
     u32 execution_generation() const { return m_execution_generation; }
     u32 execution_generation() const { return m_execution_generation; }
     void finish_execution_generation() { ++m_execution_generation; }
     void finish_execution_generation() { ++m_execution_generation; }