diff --git a/Libraries/LibJS/Runtime/Shape.cpp b/Libraries/LibJS/Runtime/Shape.cpp index 9d5e79eeaa..ecfb4b1145 100644 --- a/Libraries/LibJS/Runtime/Shape.cpp +++ b/Libraries/LibJS/Runtime/Shape.cpp @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -145,8 +146,7 @@ void Shape::ensure_property_table() const return; m_property_table = make>(); - // FIXME: We need to make sure the GC doesn't collect the transition chain as we're building it. - // Maybe some kind of RAII "prevent GC for a moment" helper thingy? + DeferGC defer(heap()); Vector transition_chain; for (auto* shape = this; shape->m_previous; shape = shape->m_previous) {