| 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/elements.h" | 7 #include "src/elements.h" |
| 8 #include "src/factory.h" | 8 #include "src/factory.h" |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 store_position++; | 245 store_position++; |
| 246 } | 246 } |
| 247 if (store_position == 0) return isolate->factory()->empty_fixed_array(); | 247 if (store_position == 0) return isolate->factory()->empty_fixed_array(); |
| 248 keys->Shrink(store_position); | 248 keys->Shrink(store_position); |
| 249 return keys; | 249 return keys; |
| 250 } | 250 } |
| 251 | 251 |
| 252 // Returns "nothing" in case of exception, "true" on success. | 252 // Returns "nothing" in case of exception, "true" on success. |
| 253 Maybe<bool> KeyAccumulator::AddKeysFromProxy(Handle<JSProxy> proxy, | 253 Maybe<bool> KeyAccumulator::AddKeysFromProxy(Handle<JSProxy> proxy, |
| 254 Handle<FixedArray> keys) { | 254 Handle<FixedArray> keys) { |
| 255 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 255 if (filter_proxy_keys_) { |
| 256 isolate_, keys, FilterProxyKeys(isolate_, proxy, keys, filter_), | 256 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| 257 Nothing<bool>()); | 257 isolate_, keys, FilterProxyKeys(isolate_, proxy, keys, filter_), |
| 258 Nothing<bool>()); |
| 259 } |
| 258 // Proxies define a complete list of keys with no distinction of | 260 // Proxies define a complete list of keys with no distinction of |
| 259 // elements and properties, which breaks the normal assumption for the | 261 // elements and properties, which breaks the normal assumption for the |
| 260 // KeyAccumulator. | 262 // KeyAccumulator. |
| 261 if (type_ == OWN_ONLY) { | 263 if (type_ == OWN_ONLY) { |
| 262 ownProxyKeys_ = keys; | 264 ownProxyKeys_ = keys; |
| 263 level_string_length_ = keys->length(); | 265 level_string_length_ = keys->length(); |
| 264 length_ = level_string_length_; | 266 length_ = level_string_length_; |
| 265 } else { | 267 } else { |
| 266 AddKeys(keys, PROXY_MAGIC); | 268 AddKeys(keys, PROXY_MAGIC); |
| 267 } | 269 } |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 return keys; | 433 return keys; |
| 432 } | 434 } |
| 433 } | 435 } |
| 434 // The properties-only case failed because there were probably elements on the | 436 // The properties-only case failed because there were probably elements on the |
| 435 // receiver. | 437 // receiver. |
| 436 return GetOwnKeysWithElements(isolate_, object, convert); | 438 return GetOwnKeysWithElements(isolate_, object, convert); |
| 437 } | 439 } |
| 438 | 440 |
| 439 MaybeHandle<FixedArray> FastKeyAccumulator::GetKeysSlow( | 441 MaybeHandle<FixedArray> FastKeyAccumulator::GetKeysSlow( |
| 440 GetKeysConversion convert) { | 442 GetKeysConversion convert) { |
| 441 return JSReceiver::GetKeys(receiver_, type_, ENUMERABLE_STRINGS); | 443 return JSReceiver::GetKeys(receiver_, type_, ENUMERABLE_STRINGS, KEEP_NUMBERS, |
| 444 filter_proxy_keys_); |
| 442 } | 445 } |
| 443 | 446 |
| 444 } // namespace internal | 447 } // namespace internal |
| 445 } // namespace v8 | 448 } // namespace v8 |
| OLD | NEW |