From f56bf610c47928594d8d00c9120f887739fe2979 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 8 Mar 2022 12:04:11 -0500 Subject: [PATCH] LibJS: Allow pre-allocating DeclarativeEnvironment's bindings list --- Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h index f118024146..85d98298ca 100644 --- a/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/DeclarativeEnvironment.h @@ -49,6 +49,11 @@ public: ThrowCompletionOr get_binding_value_direct(GlobalObject&, size_t index, bool strict); ThrowCompletionOr set_mutable_binding_direct(GlobalObject&, size_t index, Value, bool strict); + void ensure_capacity(size_t capacity) + { + m_bindings.ensure_capacity(capacity); + } + protected: virtual void visit_edges(Visitor&) override;