Bug 1000944. Allow unions and dictionaries that contain non-SpiderMonkey WebIDL interface types to be copy-constructed. r=dzbarsky
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 26 Apr 2014 21:49:59 -0400
changeset 180860 252653fe3a934b7106cdf929f2ac9ee6d821e818
parent 180859 2f394d14ac89d54511dd36bfc0f4718492bcbaec
child 180861 93a71ca8b150771199a0293a8e1f8d2f6fbee345
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersdzbarsky
bugs1000944
milestone31.0a1
Bug 1000944. Allow unions and dictionaries that contain non-SpiderMonkey WebIDL interface types to be copy-constructed. r=dzbarsky
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -40,17 +40,21 @@ def toBindingNamespace(arg):
 
 def isTypeCopyConstructible(type):
     # Nullable and sequence stuff doesn't affect copy/constructibility
     type = type.unroll()
     return (type.isPrimitive() or type.isString() or type.isEnum() or
             (type.isUnion() and
              CGUnionStruct.isUnionCopyConstructible(type)) or
             (type.isDictionary() and
-             CGDictionary.isDictionaryCopyConstructible(type.inner)))
+             CGDictionary.isDictionaryCopyConstructible(type.inner)) or
+            # Interface types are only copy-constructible if they're Gecko
+            # interfaces.  SpiderMonkey interfaces are not copy-constructible
+            # because of rooting issues.
+            (type.isInterface() and type.isGeckoInterface()))
 
 
 def wantsAddProperty(desc):
     return (desc.concrete and
             desc.wrapperCache and
             not (desc.workers and
                  desc.interface.getExtendedAttribute("Global")))