diff --git a/Jint/Native/Array/ArrayInstance.cs b/Jint/Native/Array/ArrayInstance.cs index 7115d1ca4..a16eef472 100644 --- a/Jint/Native/Array/ArrayInstance.cs +++ b/Jint/Native/Array/ArrayInstance.cs @@ -951,9 +951,7 @@ internal void EnsureCapacity(uint capacity, bool force = false) } // need to grow - var newArray = new JsValue[capacity]; - System.Array.Copy(dense, newArray, dense.Length); - _dense = newArray; + System.Array.Resize(ref _dense, (int) capacity); } public JsValue[] ToArray()