Bug 750264. Give IDLType an operator!= so that codegen actually works correctly. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 25 May 2012 01:07:30 -0400
changeset 94813 846a1c3abadcf29e94703d46326a5e60c06dfcc9
parent 94812 faa1929dc2471759a90409ce4b478e57c18403e5
child 94814 9d354b418ea7125039f7b9844c44a5999d3931b9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerskhuey
bugs750264
milestone15.0a1
Bug 750264. Give IDLType an operator!= so that codegen actually works correctly. r=khuey
dom/bindings/parser/WebIDL.py
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -578,16 +578,19 @@ class IDLType(IDLObject):
     def __init__(self, location, name):
         IDLObject.__init__(self, location)
         self.name = name
         self.builtin = False
 
     def __eq__(self, other):
         return other and self.name == other.name and self.builtin == other.builtin
 
+    def __ne__(self, other):
+        return not self == other
+
     def __str__(self):
         return str(self.name)
 
     def isType(self):
         return True
 
     def nullable(self):
         return False
@@ -995,17 +998,18 @@ class IDLTypedefType(IDLType, IDLObjectW
 class IDLWrapperType(IDLType):
     def __init__(self, location, inner):
         IDLType.__init__(self, location, inner.identifier.name)
         self.inner = inner
         self._identifier = inner.identifier
         self.builtin = False
 
     def __eq__(self, other):
-        return other and self._identifier == other._identifier and \
+        return isinstance(other, IDLWrapperType) and \
+               self._identifier == other._identifier and \
                self.builtin == other.builtin
 
     def __str__(self):
         return str(self.name) + " (Wrapper)"
 
     def nullable(self):
         return False