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

Unified Diff: src/objects.cc

Issue 2686513002: [key] Fix for-in with trailing shadowing keys with dict-mode receiver (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | test/mjsunit/for-in.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index c7a5ab69ffe0787abcfe426800be690488c25e5c..fb4f69846d52128bc9d12c7fd0ca26238ba3ede4 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -18047,6 +18047,7 @@ void Dictionary<Derived, Shape, Key>::CopyEnumKeysTo(
Handle<Dictionary<Derived, Shape, Key>> dictionary,
Handle<FixedArray> storage, KeyCollectionMode mode,
KeyAccumulator* accumulator) {
+ DCHECK_IMPLIES(mode != KeyCollectionMode::kOwnOnly, accumulator != nullptr);
Isolate* isolate = dictionary->GetIsolate();
int length = storage->length();
int capacity = dictionary->Capacity();
@@ -18072,7 +18073,7 @@ void Dictionary<Derived, Shape, Key>::CopyEnumKeysTo(
storage->set(properties, Smi::FromInt(i));
}
properties++;
- if (properties == length) break;
+ if (mode == KeyCollectionMode::kOwnOnly && properties == length) break;
}
CHECK_EQ(length, properties);
« no previous file with comments | « no previous file | test/mjsunit/for-in.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698