| 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 from generator import AnalyzeOperation, ConstantOutputOrder, \ | 10 from generator import AnalyzeOperation, ConstantOutputOrder, \ |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 if not interface.parents: | 170 if not interface.parents: |
| 171 return | 171 return |
| 172 | 172 |
| 173 parent_name = interface.parents[0].type.id | 173 parent_name = interface.parents[0].type.id |
| 174 parent = self._database.GetInterface(parent_name) | 174 parent = self._database.GetInterface(parent_name) |
| 175 if parent == self._interface or parent == interface: | 175 if parent == self._interface or parent == interface: |
| 176 return | 176 return |
| 177 | 177 |
| 178 # Never remove operations that are added as a result of an implements they | 178 # Never remove operations that are added as a result of an implements they |
| 179 # are pure interfaces (mixins to this interface). | 179 # are pure interfaces (mixins to this interface). |
| 180 if (IsPureInterface(parent_name)): | 180 if (IsPureInterface(parent_name, self._database)): |
| 181 return | 181 return |
| 182 | 182 |
| 183 for operation in parent.operations: | 183 for operation in parent.operations: |
| 184 if operation.id in operationsByName: | 184 if operation.id in operationsByName: |
| 185 operations = operationsByName[operation.id] | 185 operations = operationsByName[operation.id] |
| 186 for existing_operation in operations: | 186 for existing_operation in operations: |
| 187 if existing_operation.SameSignatureAs(operation): | 187 if existing_operation.SameSignatureAs(operation): |
| 188 del operationsByName[operation.id] | 188 del operationsByName[operation.id] |
| 189 | 189 |
| 190 def _AddRenamedOverloads(self, interface): | 190 def _AddRenamedOverloads(self, interface): |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 def _InputType(self, type_name, info): | 888 def _InputType(self, type_name, info): |
| 889 conversion = self._InputConversion(type_name, info.declared_name) | 889 conversion = self._InputConversion(type_name, info.declared_name) |
| 890 if conversion: | 890 if conversion: |
| 891 return conversion.input_type | 891 return conversion.input_type |
| 892 else: | 892 else: |
| 893 # If typedef it's a union return dynamic. | 893 # If typedef it's a union return dynamic. |
| 894 if self._database.HasTypeDef(type_name): | 894 if self._database.HasTypeDef(type_name): |
| 895 return 'dynamic' | 895 return 'dynamic' |
| 896 else: | 896 else: |
| 897 return self._NarrowInputType(type_name) if type_name else 'dynamic' | 897 return self._NarrowInputType(type_name) if type_name else 'dynamic' |
| OLD | NEW |