Преглед изворни кода

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 година
родитељ
комит
b821356ba6
1 измењених фајлова са 3 додато и 0 уклоњено
  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; };
 
+    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; }
     void finish_execution_generation() { ++m_execution_generation; }