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: |