mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:57:44 +00:00
LibJS: Move creation of global symbols into Symbol.for()
This is now according to the spec. Having a non-standard lookup API that creates symbols on the fly doesn't seem ideal.
This commit is contained in:
parent
b821356ba6
commit
f490ba13ff
3 changed files with 25 additions and 16 deletions
|
@ -231,17 +231,6 @@ void VM::gather_roots(HashTable<Cell*>& roots)
|
|||
roots.set(finalization_registry);
|
||||
}
|
||||
|
||||
Symbol* VM::get_global_symbol(DeprecatedString const& 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_registry.set(description, *new_global_symbol);
|
||||
return new_global_symbol;
|
||||
}
|
||||
|
||||
ThrowCompletionOr<Value> VM::named_evaluation_if_anonymous_function(ASTNode const& expression, FlyString const& name)
|
||||
{
|
||||
// 8.3.3 Static Semantics: IsAnonymousFunctionDefinition ( expr ), https://tc39.es/ecma262/#sec-isanonymousfunctiondefinition
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue