Index: client/dom/scripts/databasebuilder.py |
diff --git a/client/dom/scripts/databasebuilder.py b/client/dom/scripts/databasebuilder.py |
index a08857464747d67e97ced21e6485c02dffb7b26f..4003e124681b8af7d320e63c4d05c363af24c6d2 100755 |
--- a/client/dom/scripts/databasebuilder.py |
+++ b/client/dom/scripts/databasebuilder.py |
@@ -447,19 +447,29 @@ class DatabaseBuilder(object): |
# Step 3: Merge in supplemental interfaces |
for interface, module_name, import_options in self._imported_interfaces: |
- if interface.is_supplemental: |
- target_name = interface.ext_attrs['Supplemental'] |
- if target_name: |
- # [Supplemental=DOMWindow] - merge into DOMWindow. |
- target = target_name |
- else: |
- # [Supplemental] - merge into existing inteface with same name. |
- target = interface.id |
- if self._database.HasInterface(target): |
- old_interface = self._database.GetInterface(target) |
- self._merge_interfaces(old_interface, interface, import_options) |
- else: |
- raise Exception("Supplemental target '%s' not found", target) |
+ if not interface.is_supplemental: |
+ continue |
+ |
+ target_name = interface.ext_attrs['Supplemental'] or interface.id |
+ if not self._database.HasInterface(target_name): |
+ raise Exception("Supplemental target '%s' not found", target_name) |
+ target_interface = self._database.GetInterface(target_name) |
+ self._merge_interfaces(target_interface, interface, import_options) |
+ |
+ if target_name == interface.id: |
+ # [Supplemental] - merged into existing inteface with same name. |
+ continue |
+ |
+ # [Supplemental=DOMWindow] - merged into DOMWindow. Mark operations and |
+ # attributes as [ImplementedBy=Interface] |
+ attributes = set([attribute.id for attribute in interface.attributes]) |
+ for attribute in target_interface.attributes: |
+ if attribute.id in attributes: |
+ attribute.ext_attrs['ImplementedBy'] = interface.id |
+ operations = set([operation.id for operation in interface.operations]) |
+ for operation in target_interface.operations: |
+ if operation.id in operations: |
sra1
2012/02/06 18:14:36
Is it possible that foo(int) is implemented by I1
|
+ operation.ext_attrs['ImplementedBy'] = interface.id |
# Step 4: Resolve 'implements' statements |
for impl_stmt, import_options in self._impl_stmts: |