1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

LibJS: Rename m_global_symbol_map to m_global_symbol_registry

The spec calls it "GlobalSymbolRegistry".
This commit is contained in:
Linus Groh 2022-12-06 20:58:15 +00:00
parent 112b3f7342
commit 2c579ed0df
2 changed files with 5 additions and 4 deletions

View file

@ -224,7 +224,7 @@ void VM::gather_roots(HashTable<Cell*>& roots)
JS_ENUMERATE_WELL_KNOWN_SYMBOLS JS_ENUMERATE_WELL_KNOWN_SYMBOLS
#undef __JS_ENUMERATE #undef __JS_ENUMERATE
for (auto& symbol : m_global_symbol_map) for (auto& symbol : m_global_symbol_registry)
roots.set(symbol.value); roots.set(symbol.value);
for (auto* finalization_registry : m_finalization_registry_cleanup_jobs) for (auto* finalization_registry : m_finalization_registry_cleanup_jobs)
@ -233,12 +233,12 @@ void VM::gather_roots(HashTable<Cell*>& roots)
Symbol* VM::get_global_symbol(DeprecatedString const& description) Symbol* VM::get_global_symbol(DeprecatedString const& description)
{ {
auto result = m_global_symbol_map.get(description); auto result = m_global_symbol_registry.get(description);
if (result.has_value()) if (result.has_value())
return result.value(); return result.value();
auto new_global_symbol = js_symbol(*this, description, true); auto new_global_symbol = js_symbol(*this, description, true);
m_global_symbol_map.set(description, new_global_symbol); m_global_symbol_registry.set(description, new_global_symbol);
return new_global_symbol; return new_global_symbol;
} }

View file

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