浏览代码

LibJS: Store NonnullGCPtr<Symbol> values in m_global_symbol_registry

Linus Groh 2 年之前
父节点
当前提交
d5457375e6
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      Userland/Libraries/LibJS/Runtime/VM.cpp
  2. 1 1
      Userland/Libraries/LibJS/Runtime/VM.h

+ 2 - 2
Userland/Libraries/LibJS/Runtime/VM.cpp

@@ -237,8 +237,8 @@ Symbol* VM::get_global_symbol(DeprecatedString const& description)
     if (result.has_value())
     if (result.has_value())
         return result.value();
         return result.value();
 
 
-    auto new_global_symbol = js_symbol(*this, description, true);
-    m_global_symbol_registry.set(description, new_global_symbol);
+    auto* new_global_symbol = js_symbol(*this, description, true);
+    m_global_symbol_registry.set(description, *new_global_symbol);
     return new_global_symbol;
     return new_global_symbol;
 }
 }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/VM.h

@@ -265,7 +265,7 @@ private:
     StackInfo m_stack_info;
     StackInfo m_stack_info;
 
 
     // GlobalSymbolRegistry, https://tc39.es/ecma262/#table-globalsymbolregistry-record-fields
     // GlobalSymbolRegistry, https://tc39.es/ecma262/#table-globalsymbolregistry-record-fields
-    HashMap<DeprecatedString, Symbol*> m_global_symbol_registry;
+    HashMap<DeprecatedString, NonnullGCPtr<Symbol>> m_global_symbol_registry;
 
 
     Vector<Function<ThrowCompletionOr<Value>()>> m_promise_jobs;
     Vector<Function<ThrowCompletionOr<Value>()>> m_promise_jobs;