Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: tools/dom/scripts/database.py

Issue 1727233003: Fixed handle of multi-inheritance (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/database.py
diff --git a/tools/dom/scripts/database.py b/tools/dom/scripts/database.py
index 19ca2224ee55b99e13d730e8adf30332fbed6f2d..7329b22a0ee07315a8c6d735d37f97c60e7f98f8 100755
--- a/tools/dom/scripts/database.py
+++ b/tools/dom/scripts/database.py
@@ -314,24 +314,30 @@ class Database(object):
The list contains the interface objects for interfaces defined in the
database, and the name for undefined interfaces.
"""
- def walk(parents):
+ def walk(parents, walk_result):
for parent in parents:
parent_name = parent.type.id
if IsDartCollectionType(parent_name):
- result.append(parent_name)
+ if not(parent_name in walk_result):
+ walk_result.append(parent_name)
continue
if self.HasInterface(parent_name):
parent_interface = self.GetInterface(parent_name)
- result.append(parent_interface)
- walk(parent_interface.parents)
+ if not(parent_interface in walk_result):
+ # Interface has multi-inherited don't add interfaces more than once
+ # to our parent result list.
+ walk_result.append(parent_interface)
+ walk(parent_interface.parents, walk_result)
+ return walk_result
result = []
if interface.parents:
parent = interface.parents[0]
if (IsPureInterface(parent.type.id) or
(propagate_event_target and parent.type.id == 'EventTarget')):
- walk(interface.parents)
+ result = walk(interface.parents, [])
else:
- walk(interface.parents[1:])
+ result = walk(interface.parents[1:], [])
+
return result
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698