Bug 822080 - use defineProperty instead of setGeneric during cloning of object properties for self-hosting. r=jwalden
authorTill Schneidereit <tschneidereit@gmail.com>
Fri, 15 Feb 2013 23:32:52 +0100
changeset 122081 88361e96d89fac2ae50761a193c8b61e984d01ea
parent 122080 9a12a0f8c8beb183201fddcb993b84159f9f7520
child 122082 eba1ef07a9adb489b79df6d3cec8958ea47f28d7
push id23087
push usertschneidereit@gmail.com
push dateFri, 15 Feb 2013 22:33:18 +0000
treeherdermozilla-inbound@88361e96d89f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs822080
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 822080 - use defineProperty instead of setGeneric during cloning of object properties for self-hosting. r=jwalden
js/src/vm/SelfHosting.cpp
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -393,17 +393,17 @@ CloneProperties(JSContext *cx, HandleObj
         AutoCompartment ac(cx, obj);
         if (!GetPropertyNames(cx, obj, JSITER_OWNONLY, &ids))
             return false;
     }
     for (uint32_t i = 0; i < ids.length(); i++) {
         id = ids[i];
         if (!GetUnclonedValue(cx, obj, id, &val) ||
             !CloneValue(cx, &val, clonedObjects) ||
-            !JSObject::setGeneric(cx, clone, clone, id, &val, false))
+            !JS_DefinePropertyById(cx, clone, id, val.get(), NULL, NULL, 0))
         {
             return false;
         }
     }
     return true;
 }
 static RawObject
 CloneObject(JSContext *cx, HandleObject srcObj, CloneMemory &clonedObjects)