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

Side by Side Diff: tools/dom/scripts/database.py

Issue 22594012: Treat EventTarget as a secondary superclass (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """Module to manage IDL files.""" 6 """Module to manage IDL files."""
7 7
8 import copy 8 import copy
9 import pickle 9 import pickle
10 import logging 10 import logging
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 def TransitiveSecondaryParents(self, interface): 250 def TransitiveSecondaryParents(self, interface):
251 """Returns a list of all non-primary parents. 251 """Returns a list of all non-primary parents.
252 252
253 The list contains the interface objects for interfaces defined in the 253 The list contains the interface objects for interfaces defined in the
254 database, and the name for undefined interfaces. 254 database, and the name for undefined interfaces.
255 """ 255 """
256 def walk(parents): 256 def walk(parents):
257 for parent in parents: 257 for parent in parents:
258 parent_name = parent.type.id 258 parent_name = parent.type.id
259 if parent_name == 'EventTarget':
260 # Currently EventTarget is implemented as a mixin, not a proper
261 # super interface---ignore its members.
262 continue
263 if IsDartCollectionType(parent_name): 259 if IsDartCollectionType(parent_name):
264 result.append(parent_name) 260 result.append(parent_name)
265 continue 261 continue
266 if self.HasInterface(parent_name): 262 if self.HasInterface(parent_name):
267 parent_interface = self.GetInterface(parent_name) 263 parent_interface = self.GetInterface(parent_name)
268 result.append(parent_interface) 264 result.append(parent_interface)
269 walk(parent_interface.parents) 265 walk(parent_interface.parents)
270 266
271 result = [] 267 result = []
272 if interface.parents: 268 if interface.parents:
273 parent = interface.parents[0] 269 parent = interface.parents[0]
274 if IsPureInterface(parent.type.id): 270 if IsPureInterface(parent.type.id) or parent.type.id == 'EventTarget':
275 walk(interface.parents) 271 walk(interface.parents)
276 else: 272 else:
277 walk(interface.parents[1:]) 273 walk(interface.parents[1:])
278 return result 274 return result
279 275
OLDNEW
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698