Chromium Code Reviews| Index: src/keys.cc |
| diff --git a/src/keys.cc b/src/keys.cc |
| index fa1a340b615f5e52888ac4330df4d427763b2d42..3797af29b2ba8d22629706f513eb1ad7bf664580 100644 |
| --- a/src/keys.cc |
| +++ b/src/keys.cc |
| @@ -35,10 +35,9 @@ static bool ContainsOnlyValidKeys(Handle<FixedArray> array) { |
| // static |
| MaybeHandle<FixedArray> KeyAccumulator::GetKeys( |
| Handle<JSReceiver> object, KeyCollectionMode mode, PropertyFilter filter, |
| - GetKeysConversion keys_conversion, bool filter_proxy_keys, bool is_for_in) { |
| + GetKeysConversion keys_conversion, bool is_for_in) { |
| Isolate* isolate = object->GetIsolate(); |
| FastKeyAccumulator accumulator(isolate, object, mode, filter); |
| - accumulator.set_filter_proxy_keys(filter_proxy_keys); |
| accumulator.set_is_for_in(is_for_in); |
| return accumulator.GetKeys(keys_conversion); |
| } |
| @@ -135,16 +134,17 @@ MaybeHandle<FixedArray> FilterProxyKeys(KeyAccumulator* accumulator, |
| // Returns "nothing" in case of exception, "true" on success. |
| Maybe<bool> KeyAccumulator::AddKeysFromJSProxy(Handle<JSProxy> proxy, |
| Handle<FixedArray> keys) { |
| - if (filter_proxy_keys_) { |
| + // Postpone the enumerable check for for-in to the ForInFilter step. |
| + if (!is_for_in_) { |
| DCHECK(!is_for_in_); |
|
adamk
2016/07/28 18:03:13
I think this DCHECK can safely die now :)
Camillo Bruni
2016/07/29 08:31:07
better be sure :D
|
| ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| isolate_, keys, FilterProxyKeys(this, proxy, keys, filter_), |
| Nothing<bool>()); |
| - } |
| - if (mode_ == KeyCollectionMode::kOwnOnly && !is_for_in_) { |
| - // If we collect only the keys from a JSProxy do not sort or deduplicate it. |
| - keys_ = keys; |
| - return Just(true); |
| + if (mode_ == KeyCollectionMode::kOwnOnly) { |
| + // If we collect only the keys from a JSProxy do not sort or deduplicate. |
| + keys_ = keys; |
| + return Just(true); |
| + } |
| } |
| AddKeys(keys, is_for_in_ ? CONVERT_TO_ARRAY_INDEX : DO_NOT_CONVERT); |
| return Just(true); |
| @@ -444,7 +444,6 @@ MaybeHandle<FixedArray> FastKeyAccumulator::GetKeysFast( |
| MaybeHandle<FixedArray> FastKeyAccumulator::GetKeysSlow( |
| GetKeysConversion keys_conversion) { |
| KeyAccumulator accumulator(isolate_, mode_, filter_); |
| - accumulator.set_filter_proxy_keys(filter_proxy_keys_); |
| accumulator.set_is_for_in(is_for_in_); |
| accumulator.set_last_non_empty_prototype(last_non_empty_prototype_); |
| @@ -860,13 +859,9 @@ Maybe<bool> KeyAccumulator::CollectOwnJSProxyTargetKeys( |
| ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| isolate_, keys, |
| KeyAccumulator::GetKeys(target, KeyCollectionMode::kOwnOnly, filter_, |
| - GetKeysConversion::kConvertToString, |
| - filter_proxy_keys_, is_for_in_), |
| + GetKeysConversion::kConvertToString, is_for_in_), |
| Nothing<bool>()); |
| - bool prev_filter_proxy_keys_ = filter_proxy_keys_; |
| - filter_proxy_keys_ = false; |
| Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); |
| - filter_proxy_keys_ = prev_filter_proxy_keys_; |
| return result; |
| } |