Index: src/elements.cc |
diff --git a/src/elements.cc b/src/elements.cc |
index e4cc7efb9fd6ed51bc734e6e47dae7155b69c69c..28700b8f0abe31e90e32a0f2c6be65d787c915dd 100644 |
--- a/src/elements.cc |
+++ b/src/elements.cc |
@@ -859,6 +859,10 @@ class ElementsAccessorBase : public ElementsAccessor { |
KeyAccumulator* keys, uint32_t range, |
PropertyFilter filter, |
uint32_t offset) { |
+ if (filter & ONLY_ALL_CAN_READ) { |
+ // Non-dictionary elements can't have all-can-read accessors. |
+ return; |
+ } |
uint32_t length = 0; |
if (object->IsJSArray()) { |
length = Smi::cast(JSArray::cast(*object)->length())->value(); |
@@ -1140,6 +1144,12 @@ class DictionaryElementsAccessor |
uint32_t index = static_cast<uint32_t>(k->Number()); |
if (index < offset) continue; |
PropertyDetails details = dictionary->DetailsAt(i); |
+ if (filter & ONLY_ALL_CAN_READ) { |
+ if (details.kind() != kAccessor) continue; |
+ Object* accessors = dictionary->ValueAt(i); |
+ if (!accessors->IsAccessorInfo()) continue; |
+ if (!AccessorInfo::cast(accessors)->all_can_read()) continue; |
+ } |
PropertyAttributes attr = details.attributes(); |
if ((attr & filter) != 0) continue; |
keys->AddKey(index); |