mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17: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
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
virtual Object* with_base_object() const { return nullptr; }
|
||||
|
||||
virtual bool has_binding([[maybe_unused]] FlyString const& name) const { return false; }
|
||||
virtual bool has_binding([[maybe_unused]] FlyString const& name, [[maybe_unused]] Optional<size_t>* out_index = nullptr) const { return false; }
|
||||
virtual void create_mutable_binding(GlobalObject&, [[maybe_unused]] FlyString const& name, [[maybe_unused]] bool can_be_deleted) { }
|
||||
virtual void create_immutable_binding(GlobalObject&, [[maybe_unused]] FlyString const& name, [[maybe_unused]] bool strict) { }
|
||||
virtual void initialize_binding(GlobalObject&, [[maybe_unused]] FlyString const& name, Value) { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue