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

Unified Diff: src/objects.cc

Issue 1637753004: [es7] refactor and fix Object.values() / Object.entries() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: keepin it fresh Created 4 years, 11 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ab6fa54859416d80a4601f1d25358bfe2cbd5221..cc30667403d4934f36c51316806337212351f205 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8921,6 +8921,29 @@ MaybeHandle<FixedArray> JSReceiver::GetKeys(Handle<JSReceiver> object,
return keys;
}
+MaybeHandle<FixedArray> JSReceiver::GetOwnValues(
+ Handle<JSReceiver> object, PropertyFilter filter,
+ GetKeysConversion keys_conversion) {
+ USE(ContainsOnlyValidKeys);
Camillo Bruni 2016/02/03 12:03:48 Probably you wanted to add a DCHECK(ContainsOnlyVa
caitp (gmail) 2016/02/03 12:57:30 Not sure why I added this, copy/paste code? There
+ Isolate* isolate = object->GetIsolate();
+ KeyAccumulator accumulator(isolate, filter);
+ MAYBE_RETURN(
+ GetKeys_Internal(isolate, object, object, OWN_ONLY, filter, &accumulator),
+ MaybeHandle<FixedArray>());
+ return accumulator.GetValues(object, keys_conversion);
+}
+
+MaybeHandle<FixedArray> JSReceiver::GetOwnEntries(
+ Handle<JSReceiver> object, PropertyFilter filter,
+ GetKeysConversion keys_conversion) {
+ USE(ContainsOnlyValidKeys);
Camillo Bruni 2016/02/03 12:03:49 same here :)
+ Isolate* isolate = object->GetIsolate();
+ KeyAccumulator accumulator(isolate, filter);
+ MAYBE_RETURN(
+ GetKeys_Internal(isolate, object, object, OWN_ONLY, filter, &accumulator),
+ MaybeHandle<FixedArray>());
+ return accumulator.GetEntries(object, keys_conversion);
+}
bool Map::DictionaryElementsInPrototypeChainOnly() {
if (IsDictionaryElementsKind(elements_kind())) {
« src/key-accumulator.cc ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698