Fix^2 HasEnumerableElements

Arguments objects can have packed elements too.

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/1517073003

Cr-Commit-Position: refs/heads/master@{#32797}
This commit is contained in:
jkummerow 2015-12-11 06:08:09 -08:00 committed by Commit bot
parent 97161a29ed
commit 430bfd1b02

View File

@ -7982,8 +7982,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: