Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index d5e8b73ef26b72c4e3eea0f5d097c1fb2b56db55..e25e7f10de1697dfa2d9b21e1bbda6407e688d2e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -7985,8 +7985,9 @@ bool HasEnumerableElements(JSObject* object) { |
case FAST_SMI_ELEMENTS: |
case FAST_ELEMENTS: |
case FAST_DOUBLE_ELEMENTS: { |
- DCHECK(object->IsJSArray()); |
- int length = Smi::cast(JSArray::cast(object)->length())->value(); |
+ int length = object->IsJSArray() |
+ ? Smi::cast(JSArray::cast(object)->length())->value() |
+ : object->elements()->length(); |
return length > 0; |
} |
case FAST_HOLEY_SMI_ELEMENTS: |