From b32c0c81815b42a28c257cce18535e752a3ea360 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 8 Sep 2020 14:16:59 +0200 Subject: [PATCH] LibJS: Convert two suspicious Vector to MarkedValueList --- Libraries/LibJS/Runtime/ArrayConstructor.cpp | 2 +- Libraries/LibJS/Runtime/ArrayPrototype.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Libraries/LibJS/Runtime/ArrayConstructor.cpp index c71c301147..951c0998a1 100644 --- a/Libraries/LibJS/Runtime/ArrayConstructor.cpp +++ b/Libraries/LibJS/Runtime/ArrayConstructor.cpp @@ -98,7 +98,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from) // Array.from() lets you create Arrays from: if (auto size = object->indexed_properties().array_like_size()) { // * array-like objects (objects with a length property and indexed elements) - Vector elements; + MarkedValueList elements(interpreter.heap()); elements.ensure_capacity(size); for (size_t i = 0; i < size; ++i) { elements.append(object->get(i)); diff --git a/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Libraries/LibJS/Runtime/ArrayPrototype.cpp index 5d6eeb1846..9cd764ea9c 100644 --- a/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -558,7 +558,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::reverse) if (array->indexed_properties().is_empty()) return array; - Vector array_reverse; + MarkedValueList array_reverse(interpreter.heap()); auto size = array->indexed_properties().array_like_size(); array_reverse.ensure_capacity(size);