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

Unified Diff: src/objects.cc

Issue 227483006: Version 3.25.28.6 (merged r20316, r20366, r20428, r20451) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.25
Patch Set: Created 6 years, 8 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/mips/full-codegen-mips.cc ('k') | src/parser.h » ('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 a6d0403ab5d6dbaf86eb1d6ace19eab13928676a..45220ee29132ad21a02eaff02dfd15f7f37b8b5f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11376,6 +11376,9 @@ Handle<Object> JSArray::SetElementsLength(Handle<JSArray> array,
BeginPerformSplice(array);
for (int i = 0; i < indices.length(); ++i) {
+ // For deletions where the property was an accessor, old_values[i]
+ // will be the hole, which instructs EnqueueChangeRecord to elide
+ // the "oldValue" property.
JSObject::EnqueueChangeRecord(
array, "delete", isolate->factory()->Uint32ToString(indices[i]),
old_values[i]);
@@ -11392,6 +11395,9 @@ Handle<Object> JSArray::SetElementsLength(Handle<JSArray> array,
Handle<JSArray> deleted = isolate->factory()->NewJSArray(0);
if (delete_count > 0) {
for (int i = indices.length() - 1; i >= 0; i--) {
+ // Skip deletions where the property was an accessor, leaving holes
+ // in the array of old values.
+ if (old_values[i]->IsTheHole()) continue;
JSObject::SetElement(deleted, indices[i] - index, old_values[i], NONE,
SLOPPY);
}
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698