Author: [email protected]
Date: Wed May 13 03:46:28 2009
New Revision: 1931

Added:
    branches/bleeding_edge/test/mjsunit/regress/regress-334.js   (props  
changed)
       - copied unchanged from r1905,  
/branches/bleeding_edge/test/mjsunit/bugs/bug-334.js
Removed:
    branches/bleeding_edge/test/mjsunit/bugs/bug-334.js
Modified:
    branches/bleeding_edge/src/objects.cc

Log:
Fix bug 344: always keep attributes of existing properties.
Review URL: http://codereview.chromium.org/113197

Modified: branches/bleeding_edge/src/objects.cc
==============================================================================
--- branches/bleeding_edge/src/objects.cc       (original)
+++ branches/bleeding_edge/src/objects.cc       Wed May 13 03:46:28 2009
@@ -1736,8 +1736,10 @@
        }
        return ConvertDescriptorToField(name, value, attributes);
      case CONSTANT_FUNCTION:
-      if (value == result->GetConstantFunction()) return value;
        // Only replace the function if necessary.
+      if (value == result->GetConstantFunction()) return value;
+      // 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:
-      if (value == result->GetConstantFunction()) return value;
        // Only replace the function if necessary.
+      if (value == result->GetConstantFunction()) return value;
+      // Preserve the attributes of this existing property.
+      attributes = result->GetAttributes();
        return ConvertDescriptorToFieldAndMapTransition(name, value,  
attributes);
      case CALLBACKS:
      case INTERCEPTOR:

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to