diff --git a/Userland/Libraries/LibJS/Runtime/Array.h b/Userland/Libraries/LibJS/Runtime/Array.h index d06d607079..b16f809e0d 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.h +++ b/Userland/Libraries/LibJS/Runtime/Array.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -23,12 +24,12 @@ public: static Array* create_from(GlobalObject&, Vector const&); // Non-standard but equivalent to CreateArrayFromList. template - static Array* create_from(GlobalObject& global_object, Vector& elements, Function map_fn) + static Array* create_from(GlobalObject& global_object, Span elements, Function map_fn) { auto& vm = global_object.vm(); auto values = MarkedValueList { global_object.heap() }; values.ensure_capacity(elements.size()); - for (auto& element : elements) { + for (auto const& element : elements) { values.append(map_fn(element)); VERIFY(!vm.exception()); }