| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, 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 """This module provides shared functionality for the system to generate | 6 """This module provides shared functionality for the system to generate |
| 7 Dart:html APIs from the IDL database.""" | 7 Dart:html APIs from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 TYPE=events_class) | 547 TYPE=events_class) |
| 548 | 548 |
| 549 def _TransitiveSecondaryParents(self, interface): | 549 def _TransitiveSecondaryParents(self, interface): |
| 550 """Returns a list of all non-primary parents. | 550 """Returns a list of all non-primary parents. |
| 551 | 551 |
| 552 The list contains the interface objects for interfaces defined in the | 552 The list contains the interface objects for interfaces defined in the |
| 553 database, and the name for undefined interfaces. | 553 database, and the name for undefined interfaces. |
| 554 """ | 554 """ |
| 555 def walk(parents): | 555 def walk(parents): |
| 556 for parent in parents: | 556 for parent in parents: |
| 557 if IsDartCollectionType(parent.type.id): | 557 parent_name = parent.type.id |
| 558 result.append(parent.type.id) | 558 if parent_name == 'EventTarget': |
| 559 # Currently EventTarget is implemented as a mixin, not a proper |
| 560 # super interface---ignore its members. |
| 559 continue | 561 continue |
| 560 if self._database.HasInterface(parent.type.id): | 562 if IsDartCollectionType(parent_name): |
| 561 parent_interface = self._database.GetInterface(parent.type.id) | 563 result.append(parent_name) |
| 564 continue |
| 565 if self._database.HasInterface(parent_name): |
| 566 parent_interface = self._database.GetInterface(parent_name) |
| 562 result.append(parent_interface) | 567 result.append(parent_interface) |
| 563 walk(parent_interface.parents) | 568 walk(parent_interface.parents) |
| 564 | 569 |
| 565 result = [] | 570 result = [] |
| 566 if interface.parents: | 571 if interface.parents: |
| 567 parent = interface.parents[0] | 572 parent = interface.parents[0] |
| 568 if IsPureInterface(parent.type.id): | 573 if IsPureInterface(parent.type.id): |
| 569 walk(interface.parents) | 574 walk(interface.parents) |
| 570 else: | 575 else: |
| 571 walk(interface.parents[1:]) | 576 walk(interface.parents[1:]) |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 | 1121 |
| 1117 library_emitter = self._multiemitter.FileEmitter(library_file_path) | 1122 library_emitter = self._multiemitter.FileEmitter(library_file_path) |
| 1118 library_file_dir = os.path.dirname(library_file_path) | 1123 library_file_dir = os.path.dirname(library_file_path) |
| 1119 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) | 1124 auxiliary_dir = os.path.relpath(auxiliary_dir, library_file_dir) |
| 1120 imports_emitter = library_emitter.Emit( | 1125 imports_emitter = library_emitter.Emit( |
| 1121 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) | 1126 self._template, AUXILIARY_DIR=massage_path(auxiliary_dir)) |
| 1122 for path in sorted(self._path_to_emitter.keys()): | 1127 for path in sorted(self._path_to_emitter.keys()): |
| 1123 relpath = os.path.relpath(path, library_file_dir) | 1128 relpath = os.path.relpath(path, library_file_dir) |
| 1124 imports_emitter.Emit( | 1129 imports_emitter.Emit( |
| 1125 "part '$PATH';\n", PATH=massage_path(relpath)) | 1130 "part '$PATH';\n", PATH=massage_path(relpath)) |
| OLD | NEW |