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

Unified Diff: src/objects.h

Issue 1375003002: Teach JSReceiver::GetKeys() how to include symbols (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index a9d6fff6356f5b989bd1b3d180e20cfc731583d8..c04488240d8d1d6af1f4992514747a9231c4f859 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1775,6 +1775,9 @@ enum AccessorComponent {
};
+enum KeyFilter { SKIP_SYMBOLS, INCLUDE_SYMBOLS };
+
+
// JSReceiver includes types on which properties can be defined, i.e.,
// JSObject and JSProxy.
class JSReceiver: public HeapObject {
@@ -1854,8 +1857,8 @@ class JSReceiver: public HeapObject {
// Computes the enumerable keys for a JSObject. Used for implementing
// "for (n in object) { }".
MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys(
- Handle<JSReceiver> object,
- KeyCollectionType type);
+ Handle<JSReceiver> object, KeyCollectionType type,
+ KeyFilter filter = SKIP_SYMBOLS);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver);
@@ -2519,8 +2522,6 @@ class FixedArray: public FixedArrayBase {
// Shrink length and insert filler objects.
void Shrink(int length);
- enum KeyFilter { ALL_KEYS, NON_SYMBOL_KEYS };
-
// Copy a sub array from the receiver to dest.
void CopyTo(int pos, FixedArray* dest, int dest_pos, int len);
@@ -10607,8 +10608,8 @@ class KeyAccumulator final BASE_EMBEDDED {
explicit KeyAccumulator(Isolate* isolate) : isolate_(isolate), length_(0) {}
void AddKey(Handle<Object> key, int check_limit);
- void AddKeys(Handle<FixedArray> array, FixedArray::KeyFilter filter);
- void AddKeys(Handle<JSObject> array, FixedArray::KeyFilter filter);
+ void AddKeys(Handle<FixedArray> array, KeyFilter filter);
+ void AddKeys(Handle<JSObject> array, KeyFilter filter);
void PrepareForComparisons(int count);
Handle<FixedArray> GetKeys();
« no previous file with comments | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698