Commit 430bfd1b authored by jkummerow's avatar jkummerow Committed by Commit bot

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}
parent 97161a29
...@@ -7982,8 +7982,9 @@ bool HasEnumerableElements(JSObject* object) { ...@@ -7982,8 +7982,9 @@ bool HasEnumerableElements(JSObject* object) {
case FAST_SMI_ELEMENTS: case FAST_SMI_ELEMENTS:
case FAST_ELEMENTS: case FAST_ELEMENTS:
case FAST_DOUBLE_ELEMENTS: { case FAST_DOUBLE_ELEMENTS: {
DCHECK(object->IsJSArray()); int length = object->IsJSArray()
int length = Smi::cast(JSArray::cast(object)->length())->value(); ? Smi::cast(JSArray::cast(object)->length())->value()
: object->elements()->length();
return length > 0; return length > 0;
} }
case FAST_HOLEY_SMI_ELEMENTS: case FAST_HOLEY_SMI_ELEMENTS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment