Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index d869fd0961b1413f4843f4cb8c0787dbb419fb45..30ec45199aa0a8bcc6465b251ceeff746003672a 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -1088,12 +1088,8 @@ bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver, |
length = static_cast<uint32_t>(array->length()->Number()); |
} else { |
Handle<Object> val; |
- Handle<Object> key = isolate->factory()->length_string(); |
ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
- isolate, val, Runtime::GetObjectProperty(isolate, receiver, key), |
- false); |
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, val, |
- Object::ToLength(isolate, val), false); |
+ isolate, val, Object::GetLengthFromArrayLike(isolate, receiver), false); |
// TODO(caitp): Support larger element indexes (up to 2^53-1). |
if (!val->ToUint32(&length)) { |
length = 0; |