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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |