1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +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:
Andreas Kling 2021-10-06 23:53:22 +02:00
parent 6ef5464015
commit cb696eff08
7 changed files with 13 additions and 8 deletions

View file

@ -20,7 +20,7 @@ public:
};
ObjectEnvironment(Object& binding_object, IsWithEnvironment, Environment* outer_environment);
virtual bool has_binding(FlyString const& name) const override;
virtual bool has_binding(FlyString const& name, Optional<size_t>* = nullptr) const override;
virtual void create_mutable_binding(GlobalObject&, FlyString const& name, bool can_be_deleted) override;
virtual void create_immutable_binding(GlobalObject&, FlyString const& name, bool strict) override;
virtual void initialize_binding(GlobalObject&, FlyString const& name, Value) override;