Bug 1143529 part 2. Tighten up the assert in binding Wrap methods. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 23 Mar 2015 12:18:05 -0400
changeset 263928 29db6bb53368ffd82cebaf44a21611bdf90ffb96
parent 263927 97650ddc6032bdcf2fdee62fe1cfec3c7fc9edd9
child 263929 5f23080673ee28422ca0e31a2e6e6337becf17f8
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1143529
milestone39.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 1143529 part 2. Tighten up the assert in binding Wrap methods. r=peterv
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -3279,17 +3279,19 @@ class CGWrapWithCacheMethod(CGAbstractMe
                 Argument('JS::MutableHandle<JSObject*>', 'aReflector')]
         CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'bool', args)
         self.properties = properties
 
     def definition_body(self):
         return fill(
             """
             $*{assertInheritance}
-            MOZ_ASSERT_IF(aGivenProto, !aCache->GetWrapper());
+            MOZ_ASSERT(!aCache->GetWrapper(),
+                       "You should probably not be using Wrap() directly; use "
+                       "GetOrCreateDOMReflector instead");
 
             MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),
                        "nsISupports must be on our primary inheritance chain");
 
             JS::Rooted<JSObject*> parent(aCx, WrapNativeParent(aCx, aObject->GetParentObject()));
             if (!parent) {
               return false;
             }