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:
Andreas Kling 2021-10-06 23:53:22 +02:00
commit cb696eff08
Notes: sideshowbarker 2024-07-18 02:59:24 +09:00
7 changed files with 13 additions and 8 deletions

View file

@ -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) { }