Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(983)

Side by Side Diff: src/objects.cc

Issue 2129193003: [keys] propagate PropertyFilter to proxy targets in KeyAccumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: just hardcode kConvertToStrings for proxy targets Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/keys.cc ('k') | test/mjsunit/es6/proxies-keys.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 8290 matching lines...) Expand 10 before | Expand all | Expand 10 after
8301 Handle<FixedArray> values_or_entries; 8301 Handle<FixedArray> values_or_entries;
8302 if (filter == ENUMERABLE_STRINGS) { 8302 if (filter == ENUMERABLE_STRINGS) {
8303 Maybe<bool> fast_values_or_entries = FastGetOwnValuesOrEntries( 8303 Maybe<bool> fast_values_or_entries = FastGetOwnValuesOrEntries(
8304 isolate, object, get_entries, &values_or_entries); 8304 isolate, object, get_entries, &values_or_entries);
8305 if (fast_values_or_entries.IsNothing()) return MaybeHandle<FixedArray>(); 8305 if (fast_values_or_entries.IsNothing()) return MaybeHandle<FixedArray>();
8306 if (fast_values_or_entries.FromJust()) return values_or_entries; 8306 if (fast_values_or_entries.FromJust()) return values_or_entries;
8307 } 8307 }
8308 8308
8309 PropertyFilter key_filter = 8309 PropertyFilter key_filter =
8310 static_cast<PropertyFilter>(filter & ~ONLY_ENUMERABLE); 8310 static_cast<PropertyFilter>(filter & ~ONLY_ENUMERABLE);
8311 KeyAccumulator accumulator(isolate, KeyCollectionMode::kOwnOnly, key_filter); 8311
8312 MAYBE_RETURN(accumulator.CollectKeys(object, object), 8312 Handle<FixedArray> keys;
8313 MaybeHandle<FixedArray>()); 8313 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
8314 Handle<FixedArray> keys = 8314 isolate, keys,
8315 accumulator.GetKeys(GetKeysConversion::kConvertToString); 8315 KeyAccumulator::GetKeys(object, KeyCollectionMode::kOwnOnly, key_filter,
8316 GetKeysConversion::kConvertToString),
8317 MaybeHandle<FixedArray>());
8316 8318
8317 values_or_entries = isolate->factory()->NewFixedArray(keys->length()); 8319 values_or_entries = isolate->factory()->NewFixedArray(keys->length());
8318 int length = 0; 8320 int length = 0;
8319 8321
8320 for (int i = 0; i < keys->length(); ++i) { 8322 for (int i = 0; i < keys->length(); ++i) {
8321 Handle<Name> key = Handle<Name>::cast(handle(keys->get(i), isolate)); 8323 Handle<Name> key = Handle<Name>::cast(handle(keys->get(i), isolate));
8322 8324
8323 if (filter & ONLY_ENUMERABLE) { 8325 if (filter & ONLY_ENUMERABLE) {
8324 PropertyDescriptor descriptor; 8326 PropertyDescriptor descriptor;
8325 Maybe<bool> did_get_descriptor = JSReceiver::GetOwnPropertyDescriptor( 8327 Maybe<bool> did_get_descriptor = JSReceiver::GetOwnPropertyDescriptor(
(...skipping 10612 matching lines...) Expand 10 before | Expand all | Expand 10 after
18938 18940
18939 Object* data_obj = 18941 Object* data_obj =
18940 constructor->shared()->get_api_func_data()->access_check_info(); 18942 constructor->shared()->get_api_func_data()->access_check_info();
18941 if (data_obj->IsUndefined(isolate)) return nullptr; 18943 if (data_obj->IsUndefined(isolate)) return nullptr;
18942 18944
18943 return AccessCheckInfo::cast(data_obj); 18945 return AccessCheckInfo::cast(data_obj);
18944 } 18946 }
18945 18947
18946 } // namespace internal 18948 } // namespace internal
18947 } // namespace v8 18949 } // namespace v8
OLDNEW
« no previous file with comments | « src/keys.cc ('k') | test/mjsunit/es6/proxies-keys.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698