mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibJS: Make Environment::has_binding() optionally return binding index
If the caller wants to use the binding index for anything, if there is such a thing, it can now be obtained via an optional out-parameter.
This commit is contained in:
parent
6ef5464015
commit
cb696eff08
7 changed files with 13 additions and 8 deletions
|
@ -36,7 +36,7 @@ Value GlobalEnvironment::get_this_binding(GlobalObject&) const
|
|||
}
|
||||
|
||||
// 9.1.1.4.1 HasBinding ( N ), https://tc39.es/ecma262/#sec-global-environment-records-hasbinding-n
|
||||
bool GlobalEnvironment::has_binding(FlyString const& name) const
|
||||
bool GlobalEnvironment::has_binding(FlyString const& name, Optional<size_t>*) const
|
||||
{
|
||||
if (m_declarative_record->has_binding(name))
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue