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

Unified Diff: src/objects.cc

Issue 113197: Fix bug 344: always keep attributes of existing properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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/bugs/bug-334.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 1905)
+++ src/objects.cc (working copy)
@@ -1736,8 +1736,10 @@
}
return ConvertDescriptorToField(name, value, attributes);
case CONSTANT_FUNCTION:
+ // Only replace the function if necessary.
if (value == result->GetConstantFunction()) return value;
- // Only replace the function if necessary.
+ // Preserve the attributes of this existing property.
+ attributes = result->GetAttributes();
return ConvertDescriptorToFieldAndMapTransition(name, value, attributes);
case CALLBACKS:
return SetPropertyWithCallback(result->GetCallbackObject(),
@@ -1817,8 +1819,10 @@
}
return ConvertDescriptorToField(name, value, attributes);
case CONSTANT_FUNCTION:
+ // Only replace the function if necessary.
if (value == result->GetConstantFunction()) return value;
- // Only replace the function if necessary.
+ // Preserve the attributes of this existing property.
+ attributes = result->GetAttributes();
return ConvertDescriptorToFieldAndMapTransition(name, value, attributes);
case CALLBACKS:
case INTERCEPTOR:
« no previous file with comments | « no previous file | test/mjsunit/bugs/bug-334.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698