Bug 921454 - Invert faulty assertion. r=jonco
authorBobby Holley <bobbyholley@gmail.com>
Fri, 04 Oct 2013 13:29:36 +0200
changeset 149904 896e70eccffb77aa000d493a29399368e7ca117e
parent 149903 52bd45873c876eec4c3a0bef518448a8b13de14a
child 149905 c55b7450097bb2d88dd984efa9f997f985b95270
push idunknown
push userunknown
push dateunknown
bugs921454, 773962, 808608
Bug 921454 - Invert faulty assertion. r=jonco This assertion is pretty clearly bogus, and only exists because, as it turns out, we never had any test coverage for transplanting SCSW objects with waivers. Even in the world when this stuff landed (bug 773962, which was well before the removal of Location SCSWs in bug 808608 and the conversion of Nodes to new bindings), we apparently never tested the waiver path. :-(
--- a/js/xpconnect/wrappers/WrapperFactory.cpp
+++ b/js/xpconnect/wrappers/WrapperFactory.cpp
@@ -675,17 +675,17 @@ TransplantObjectWithWrapper(JSContext *c
     RootedObject oldWaiver(cx, WrapperFactory::GetXrayWaiver(origobj));
     RootedObject newSameCompartmentWrapper(cx,
       js_TransplantObjectWithWrapper(cx, origobj, origwrapper, targetobj,
     if (!newSameCompartmentWrapper || !oldWaiver)
         return newSameCompartmentWrapper;
     RootedObject newIdentity(cx, Wrapper::wrappedObject(newSameCompartmentWrapper));
-    MOZ_ASSERT(js::IsWrapper(newIdentity));
+    MOZ_ASSERT(!js::IsWrapper(newIdentity));
     if (!FixWaiverAfterTransplant(cx, oldWaiver, newIdentity))
         return NULL;
     return newSameCompartmentWrapper;
 nsIGlobalObject *
 GetNativeForGlobal(JSObject *obj)