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

Unified Diff: src/builtins.cc

Issue 1402393003: Ensure JSProxy correctness for PrototypeIterator uses (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reword comment Created 5 years, 1 month 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/api.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index bab706e12730f0f93af71dab5422220c76f219ef..5b20fcd3784300cfdb0271f26184a911e9751091 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1083,6 +1083,14 @@ bool IterateElements(Isolate* isolate, Handle<JSObject> receiver,
break;
}
case DICTIONARY_ELEMENTS: {
+ // CollectElementIndices() can't be called when there's a JSProxy
+ // on the prototype chain.
+ for (PrototypeIterator iter(isolate, receiver); !iter.IsAtEnd();
+ iter.Advance()) {
+ if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) {
+ return IterateElementsSlow(isolate, receiver, length, visitor);
+ }
+ }
Handle<SeededNumberDictionary> dict(receiver->element_dictionary());
List<uint32_t> indices(dict->Capacity() / 2);
// Collect all indices in the object and the prototypes less
« no previous file with comments | « src/api.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698