Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 6dda62f1acb9f3957682cca2195f4187b4da4329..1554a0970656eec5d19c29296132054142f2e24d 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11934,6 +11934,9 @@ static bool GetOldValue(Isolate* isolate, |
void JSArray::SetLength(Handle<JSArray> array, uint32_t new_length) { |
// We should never end in here with a pixel or external array. |
DCHECK(array->AllowsSetLength()); |
+ if (JSArray::SetLengthWouldNormalize(array->GetHeap(), new_length)) { |
+ JSObject::NormalizeElements(array); |
+ } |
array->GetElementsAccessor()->SetLength(array, new_length); |
} |