Index: src/key-accumulator.cc |
diff --git a/src/key-accumulator.cc b/src/key-accumulator.cc |
index 43d74733225008dac4ff2563c9c6c6855de3a509..f79561b392ba51b1a77534d539780b3729f6fa7b 100644 |
--- a/src/key-accumulator.cc |
+++ b/src/key-accumulator.cc |
@@ -99,7 +99,8 @@ bool KeyAccumulator::AddKey(Object* key, AddKeyConversion convert) { |
bool KeyAccumulator::AddKey(Handle<Object> key, AddKeyConversion convert) { |
if (key->IsSymbol()) { |
- if (filter_ == SKIP_SYMBOLS) return false; |
+ if (filter_ & SKIP_SYMBOLS) return false; |
+ if (Handle<Symbol>::cast(key)->is_private()) return false; |
return AddSymbolKey(key); |
} |
// Make sure we do not add keys to a proxy-level (see AddKeysFromProxy). |
@@ -221,17 +222,20 @@ void KeyAccumulator::AddKeysFromProxy(Handle<JSObject> array_like) { |
MaybeHandle<FixedArray> FilterProxyKeys(Isolate* isolate, Handle<JSProxy> owner, |
Handle<FixedArray> keys, |
- KeyFilter filter, |
- Enumerability enum_policy) { |
- if (filter == INCLUDE_SYMBOLS && enum_policy == IGNORE_ENUMERABILITY) { |
+ PropertyFilter filter) { |
+ if (filter == ALL_PROPERTIES) { |
// Nothing to do. |
return keys; |
} |
int store_position = 0; |
for (int i = 0; i < keys->length(); ++i) { |
Handle<Name> key(Name::cast(keys->get(i)), isolate); |
- if (filter == SKIP_SYMBOLS && key->IsSymbol()) continue; // Skip this key. |
- if (enum_policy == RESPECT_ENUMERABILITY) { |
+ if (key->IsSymbol()) { |
+ if ((filter & SKIP_SYMBOLS) || Handle<Symbol>::cast(key)->is_private()) { |
+ continue; // Skip this key. |
+ } |
+ } |
+ if (filter & ONLY_ENUMERABLE) { |
PropertyDescriptor desc; |
bool found = |
JSProxy::GetOwnPropertyDescriptor(isolate, owner, key, &desc); |
@@ -252,11 +256,9 @@ MaybeHandle<FixedArray> FilterProxyKeys(Isolate* isolate, Handle<JSProxy> owner, |
// Returns "false" in case of exception, "true" on success. |
bool KeyAccumulator::AddKeysFromProxy(Handle<JSProxy> proxy, |
- Handle<FixedArray> keys, KeyFilter filter, |
- Enumerability enum_policy) { |
+ Handle<FixedArray> keys) { |
ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
- isolate_, keys, |
- FilterProxyKeys(isolate_, proxy, keys, filter, enum_policy), false); |
+ isolate_, keys, FilterProxyKeys(isolate_, proxy, keys, filter_), false); |
// Proxies define a complete list of keys with no distinction of |
// elements and properties, which breaks the normal assumption for the |
// KeyAccumulator. |