Bug 857439 Part 1: Disallow owned interfaces from having parents or children r=bz
authorDavid Zbarsky <dzbarsky@gmail.com>
Fri, 19 Apr 2013 04:49:21 -0400
changeset 129306 cef5ac2e149a
parent 129305 8674d8a06e67
child 129307 c39abce27c56
push id24567
push userryanvm@gmail.com
push date2013-04-19 17:47 +0000
treeherdermozilla-central@cbfe9618bc2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs857439
milestone23.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 857439 Part 1: Disallow owned interfaces from having parents or children r=bz
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -6618,16 +6618,21 @@ def stripTrailingWhitespace(text):
     return '\n'.join(lines) + tail
 
 class CGDescriptor(CGThing):
     def __init__(self, descriptor):
         CGThing.__init__(self)
 
         assert not descriptor.concrete or descriptor.interface.hasInterfacePrototypeObject()
 
+        if descriptor.nativeOwnership == 'owned' and (
+           descriptor.interface.hasChildInterfaces() or
+           descriptor.interface.parent):
+           raise TypeError("Owned interface cannot have a parent or children")
+
         self._deps = descriptor.interface.getDeps()
 
         cgThings = []
         # These are set to true if at least one non-static
         # method/getter/setter exist on the interface.
         (hasMethod, hasGetter, hasLenientGetter,
          hasSetter, hasLenientSetter) = False, False, False, False, False
         for n in descriptor.interface.namedConstructors: