Index: client/dom/scripts/idlnode.py |
diff --git a/client/dom/scripts/idlnode.py b/client/dom/scripts/idlnode.py |
index 356c77f1f262fc4081501e1b353e35bc9dae8acf..4f05bfddc33531fb2dd509623ae1a5b463d0435e 100755 |
--- a/client/dom/scripts/idlnode.py |
+++ b/client/dom/scripts/idlnode.py |
@@ -16,6 +16,7 @@ class IDLNode(object): |
def __init__(self, ast): |
"""Initializes an IDLNode from a PegParser AST output.""" |
self.id = self._find_first(ast, 'Id') if ast is not None else None |
+ # TODO(jacobr): move back to native_name |
def __repr__(self): |
"""Generates string of the form <class id extra extra ... 0x12345678>.""" |
@@ -351,7 +352,21 @@ class IDLInterface(IDLNode): |
self.is_supplemental = 'Supplemental' in self.ext_attrs |
self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs |
self.is_fc_suppressed = 'Suppressed' in self.ext_attrs |
+ self.native_name = self.id |
+ def has_attribute(self, candidate): |
sra1
2012/02/16 04:43:28
This is pretty much _FindMatchingAttribute
|
+ for attribute in self.attributes: |
+ if attribute.id == candidate.id and attribute.is_fc_getter == candidate.is_fc_getter and attribute.is_fc_setter == candidate.is_fc_setter: |
+ return True |
+ return False |
+ |
+ def merge(self, other): |
sra1
2012/02/16 04:43:28
Please move the merge logic, including above funct
|
+ self.operations.extend(other.operations) |
+ for attribute in other.attributes: |
+ if not self.has_attribute(attribute): |
+ self.attributes.append(attribute) |
+ |
+ self.constants.extend(other.constants) |
class IDLParentInterface(IDLNode): |
"""This IDLNode specialization is for 'Interface Child : Parent {}' |