1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibJS: Convert has_binding() to ThrowCompletionOr

Also add spec step comments to it while we're here.
This commit is contained in:
Linus Groh 2021-10-09 17:07:32 +01:00
parent 617d3cd3d3
commit fbb176c926
11 changed files with 50 additions and 29 deletions

View file

@ -35,7 +35,7 @@ void DeclarativeEnvironment::visit_edges(Visitor& visitor)
}
// 9.1.1.1.1 HasBinding ( N ), https://tc39.es/ecma262/#sec-declarative-environment-records-hasbinding-n
bool DeclarativeEnvironment::has_binding(FlyString const& name, Optional<size_t>* out_index) const
ThrowCompletionOr<bool> DeclarativeEnvironment::has_binding(FlyString const& name, Optional<size_t>* out_index) const
{
auto it = m_names.find(name);
if (it == m_names.end())