From 2c579ed0df8cb058e65f0c88b658a08785276f73 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 6 Dec 2022 20:58:15 +0000 Subject: [PATCH] LibJS: Rename m_global_symbol_map to m_global_symbol_registry The spec calls it "GlobalSymbolRegistry". --- Userland/Libraries/LibJS/Runtime/VM.cpp | 6 +++--- Userland/Libraries/LibJS/Runtime/VM.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index de2ba37203..476c3e5990 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -224,7 +224,7 @@ void VM::gather_roots(HashTable& roots) JS_ENUMERATE_WELL_KNOWN_SYMBOLS #undef __JS_ENUMERATE - for (auto& symbol : m_global_symbol_map) + for (auto& symbol : m_global_symbol_registry) roots.set(symbol.value); for (auto* finalization_registry : m_finalization_registry_cleanup_jobs) @@ -233,12 +233,12 @@ void VM::gather_roots(HashTable& roots) 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()) return result.value(); 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; } diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 415f067368..1c1ff2216a 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -264,7 +264,8 @@ private: StackInfo m_stack_info; - HashMap m_global_symbol_map; + // GlobalSymbolRegistry, https://tc39.es/ecma262/#table-globalsymbolregistry-record-fields + HashMap m_global_symbol_registry; Vector()>> m_promise_jobs;