Changed JSObject::DefineGetterSetter to also set the right attributes
authorricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 27 Jan 2010 13:53:19 +0000 (13:53 +0000)
committerricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 27 Jan 2010 13:53:19 +0000 (13:53 +0000)
when an existing accessor is redefined (a configurable accessor can
potentially be redefined as a non-configurable (i.e., DONT_DELETE)).

Review URL: http://codereview.chromium.org/556040

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3719 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc

index 118c4891d3555f68b372805da86ce547cef654f0..c76fc83377b062eaf09dffddd0936a2d6fef2534 100644 (file)
@@ -2839,7 +2839,11 @@ Object* JSObject::DefineGetterSetter(String* name,
       if (result.IsReadOnly()) return Heap::undefined_value();
       if (result.type() == CALLBACKS) {
         Object* obj = result.GetCallbackObject();
-        if (obj->IsFixedArray()) return obj;
+        if (obj->IsFixedArray()) {
+          PropertyDetails details = PropertyDetails(attributes, CALLBACKS);
+          SetNormalizedProperty(name, obj, details);
+          return obj;
+        }
       }
     }
   }