1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibJS: Add an initialize binding hint to all initialize_binding methods

This will allow us to specify things like SyncDispose and perhaps
AsyncDispose in the future.
This commit is contained in:
davidot 2022-12-14 13:26:10 +01:00 committed by Linus Groh
parent 3353cf68f1
commit a746739cb0
14 changed files with 68 additions and 57 deletions

View file

@ -231,11 +231,12 @@ DeprecatedString Reference::to_deprecated_string() const
}
// 6.2.4.8 InitializeReferencedBinding ( V, W ), https://tc39.es/ecma262/#sec-object.prototype.hasownproperty
ThrowCompletionOr<void> Reference::initialize_referenced_binding(VM& vm, Value value) const
// 1.2.1.1 InitializeReferencedBinding ( V, W, hint ), https://tc39.es/proposal-explicit-resource-management/#sec-initializereferencedbinding
ThrowCompletionOr<void> Reference::initialize_referenced_binding(VM& vm, Value value, Environment::InitializeBindingHint hint) const
{
VERIFY(!is_unresolvable());
VERIFY(m_base_type == BaseType::Environment);
return m_base_environment->initialize_binding(vm, m_name.as_string(), value);
return m_base_environment->initialize_binding(vm, m_name.as_string(), value, hint);
}
// 6.2.4.9 MakePrivateReference ( baseValue, privateIdentifier ), https://tc39.es/ecma262/#sec-makeprivatereference