| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/keys.h" | 5 #include "src/keys.h" |
| 6 | 6 |
| 7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
| 8 #include "src/elements.h" | 8 #include "src/elements.h" |
| 9 #include "src/factory.h" | 9 #include "src/factory.h" |
| 10 #include "src/identity-map.h" | 10 #include "src/identity-map.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // AdvanceFollowingProxies. | 150 // AdvanceFollowingProxies. |
| 151 if (mode_ == KeyCollectionMode::kOwnOnly && object->IsJSProxy()) { | 151 if (mode_ == KeyCollectionMode::kOwnOnly && object->IsJSProxy()) { |
| 152 MAYBE_RETURN(CollectOwnJSProxyKeys(receiver, Handle<JSProxy>::cast(object)), | 152 MAYBE_RETURN(CollectOwnJSProxyKeys(receiver, Handle<JSProxy>::cast(object)), |
| 153 Nothing<bool>()); | 153 Nothing<bool>()); |
| 154 return Just(true); | 154 return Just(true); |
| 155 } | 155 } |
| 156 | 156 |
| 157 PrototypeIterator::WhereToEnd end = mode_ == KeyCollectionMode::kOwnOnly | 157 PrototypeIterator::WhereToEnd end = mode_ == KeyCollectionMode::kOwnOnly |
| 158 ? PrototypeIterator::END_AT_NON_HIDDEN | 158 ? PrototypeIterator::END_AT_NON_HIDDEN |
| 159 : PrototypeIterator::END_AT_NULL; | 159 : PrototypeIterator::END_AT_NULL; |
| 160 for (PrototypeIterator iter(isolate_, object, | 160 for (PrototypeIterator iter(isolate_, object, kStartAtReceiver, end); |
| 161 PrototypeIterator::START_AT_RECEIVER, end); | |
| 162 !iter.IsAtEnd();) { | 161 !iter.IsAtEnd();) { |
| 163 Handle<JSReceiver> current = | 162 Handle<JSReceiver> current = |
| 164 PrototypeIterator::GetCurrent<JSReceiver>(iter); | 163 PrototypeIterator::GetCurrent<JSReceiver>(iter); |
| 165 Maybe<bool> result = Just(false); // Dummy initialization. | 164 Maybe<bool> result = Just(false); // Dummy initialization. |
| 166 if (current->IsJSProxy()) { | 165 if (current->IsJSProxy()) { |
| 167 result = CollectOwnJSProxyKeys(receiver, Handle<JSProxy>::cast(current)); | 166 result = CollectOwnJSProxyKeys(receiver, Handle<JSProxy>::cast(current)); |
| 168 } else { | 167 } else { |
| 169 DCHECK(current->IsJSObject()); | 168 DCHECK(current->IsJSObject()); |
| 170 result = CollectOwnKeys(receiver, Handle<JSObject>::cast(current)); | 169 result = CollectOwnKeys(receiver, Handle<JSObject>::cast(current)); |
| 171 } | 170 } |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 isolate_, keys, JSReceiver::OwnPropertyKeys(target), Nothing<bool>()); | 741 isolate_, keys, JSReceiver::OwnPropertyKeys(target), Nothing<bool>()); |
| 743 bool prev_filter_proxy_keys_ = filter_proxy_keys_; | 742 bool prev_filter_proxy_keys_ = filter_proxy_keys_; |
| 744 filter_proxy_keys_ = false; | 743 filter_proxy_keys_ = false; |
| 745 Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); | 744 Maybe<bool> result = AddKeysFromJSProxy(proxy, keys); |
| 746 filter_proxy_keys_ = prev_filter_proxy_keys_; | 745 filter_proxy_keys_ = prev_filter_proxy_keys_; |
| 747 return result; | 746 return result; |
| 748 } | 747 } |
| 749 | 748 |
| 750 } // namespace internal | 749 } // namespace internal |
| 751 } // namespace v8 | 750 } // namespace v8 |
| OLD | NEW |