Index: src/elements.cc |
diff --git a/src/elements.cc b/src/elements.cc |
index b4396dd90b7ff0c31c36fe41361365f4bb6e15fe..390af2c0f27b6389e09551512bef18e27d848c2c 100644 |
--- a/src/elements.cc |
+++ b/src/elements.cc |
@@ -1189,13 +1189,13 @@ class ElementsAccessorBase : public ElementsAccessor { |
static uint32_t GetEntryForIndexImpl(JSObject* holder, |
FixedArrayBase* backing_store, |
uint32_t index, PropertyFilter filter) { |
+ uint32_t length = Subclass::GetMaxIndex(holder, backing_store); |
if (IsHoleyElementsKind(kind())) { |
- return index < Subclass::GetCapacityImpl(holder, backing_store) && |
+ return index < length && |
!BackingStore::cast(backing_store)->is_the_hole(index) |
? index |
: kMaxUInt32; |
} else { |
- uint32_t length = Subclass::GetMaxIndex(holder, backing_store); |
return index < length ? index : kMaxUInt32; |
} |
} |