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

Unified Diff: src/objects.cc

Issue 11414177: When notifying observers of a truncated array, don't call getters on deleted element indices (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | test/mjsunit/harmony/object-observe.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 944c5a15e596a885beb807833bdcc40e1fad9508..6b991ebf131e100fbcefd4abe48ca8b37711bacc 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9442,8 +9442,10 @@ MaybeObject* JSArray::SetElementsLength(Object* len) {
// A non-configurable property will cause the truncation operation to
// stop at this index.
if (attributes == DONT_DELETE) break;
- // TODO(adamk): Don't fetch the old value if it's an accessor.
- old_values.Add(Object::GetElement(self, i));
+ old_values.Add(
+ self->GetLocalElementAccessorPair(i) == NULL
+ ? Object::GetElement(self, i)
+ : Handle<Object>::cast(isolate->factory()->the_hole_value()));
indices.Add(isolate->factory()->Uint32ToString(i));
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698