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

Side by Side Diff: src/key-accumulator.cc

Issue 1505253002: [proxies] Fix HasProperty and getOwnPropertySymbols (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « no previous file | src/objects.cc » ('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 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/key-accumulator.h" 5 #include "src/key-accumulator.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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 MaybeHandle<FixedArray> FilterProxyKeys(Isolate* isolate, Handle<JSProxy> owner, 224 MaybeHandle<FixedArray> FilterProxyKeys(Isolate* isolate, Handle<JSProxy> owner,
225 Handle<FixedArray> keys, 225 Handle<FixedArray> keys,
226 PropertyFilter filter) { 226 PropertyFilter filter) {
227 if (filter == ALL_PROPERTIES) { 227 if (filter == ALL_PROPERTIES) {
228 // Nothing to do. 228 // Nothing to do.
229 return keys; 229 return keys;
230 } 230 }
231 int store_position = 0; 231 int store_position = 0;
232 for (int i = 0; i < keys->length(); ++i) { 232 for (int i = 0; i < keys->length(); ++i) {
233 Handle<Name> key(Name::cast(keys->get(i)), isolate); 233 Handle<Name> key(Name::cast(keys->get(i)), isolate);
234 if (key->IsSymbol()) { 234 if (key->FilterKey(filter)) continue; // Skip this key.
235 if ((filter & SKIP_SYMBOLS) || Handle<Symbol>::cast(key)->is_private()) {
236 continue; // Skip this key.
237 }
238 }
239 if (filter & SKIP_STRINGS) continue; // Skip this key.
240 if (filter & ONLY_ENUMERABLE) { 235 if (filter & ONLY_ENUMERABLE) {
241 PropertyDescriptor desc; 236 PropertyDescriptor desc;
242 bool found = 237 bool found =
243 JSProxy::GetOwnPropertyDescriptor(isolate, owner, key, &desc); 238 JSProxy::GetOwnPropertyDescriptor(isolate, owner, key, &desc);
244 if (isolate->has_pending_exception()) return MaybeHandle<FixedArray>(); 239 if (isolate->has_pending_exception()) return MaybeHandle<FixedArray>();
245 if (!found || !desc.enumerable()) continue; // Skip this key. 240 if (!found || !desc.enumerable()) continue; // Skip this key.
246 } 241 }
247 // Keep this key. 242 // Keep this key.
248 if (store_position != i) { 243 if (store_position != i) {
249 keys->set(store_position, *key); 244 keys->set(store_position, *key);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 level_lengths_.push_back(level_symbol_length_); 305 level_lengths_.push_back(level_symbol_length_);
311 } 306 }
312 elements_.push_back(new std::vector<uint32_t>()); 307 elements_.push_back(new std::vector<uint32_t>());
313 level_string_length_ = 0; 308 level_string_length_ = 0;
314 level_symbol_length_ = 0; 309 level_symbol_length_ = 0;
315 } 310 }
316 311
317 312
318 } // namespace internal 313 } // namespace internal
319 } // namespace v8 314 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698