Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index c2ff64eb920fb079a7a448a7340fc86ccf399eb9..7504f88f6286c2fbbb8358c005113fafd735eddf 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3927,15 +3927,16 @@ MaybeObject* JSObject::PreventExtensions() { |
// Tests for the fast common case for property enumeration: |
-// - This object and all prototypes has an enum cache (which means that it has |
-// no interceptors and needs no access checks). |
+// - This object and all prototypes has an enum cache (which means that |
+// it is no proxy, has no interceptors and needs no access checks). |
// - This object has no elements. |
// - No prototype has enumerable properties/elements. |
-bool JSObject::IsSimpleEnum() { |
+bool JSReceiver::IsSimpleEnum() { |
Heap* heap = GetHeap(); |
for (Object* o = this; |
o != heap->null_value(); |
o = JSObject::cast(o)->GetPrototype()) { |
+ if (!o->IsJSObject()) return false; |
JSObject* curr = JSObject::cast(o); |
if (!curr->map()->instance_descriptors()->HasEnumCache()) return false; |
ASSERT(!curr->HasNamedInterceptor()); |