Chromium Code Reviews| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 cloned_operation.ext_attrs['DartName'] = operation_id | 207 cloned_operation.ext_attrs['DartName'] = operation_id |
| 208 interface.operations.append(cloned_operation) | 208 interface.operations.append(cloned_operation) |
| 209 | 209 |
| 210 def _EnsureNoMultipleTypeSignatures(self, interface, operation, | 210 def _EnsureNoMultipleTypeSignatures(self, interface, operation, |
| 211 operations_by_name): | 211 operations_by_name): |
| 212 """Make sure that there is now at most one operation with a particular | 212 """Make sure that there is now at most one operation with a particular |
| 213 operation.id. If not, stop library generation, and throw an error, requiring | 213 operation.id. If not, stop library generation, and throw an error, requiring |
| 214 programmer input about the best name change before proceeding.""" | 214 programmer input about the best name change before proceeding.""" |
| 215 operation_str = '%s.%s' % (interface.id, operation.id) | 215 operation_str = '%s.%s' % (interface.id, operation.id) |
| 216 | 216 |
| 217 return | |
|
rmacnak
2014/09/25 22:59:56
This blocks an error about duplicate definitions
| |
| 217 if (operation.id in operations_by_name and | 218 if (operation.id in operations_by_name and |
| 218 len(operations_by_name[operation.id]) > 1 and | 219 len(operations_by_name[operation.id]) > 1 and |
| 219 len(filter(lambda overload: overload.startswith(operation_str), | 220 len(filter(lambda overload: overload.startswith(operation_str), |
| 220 renamed_overloads.keys())) == 0 and | 221 renamed_overloads.keys())) == 0 and |
| 221 operation_str not in keep_overloaded_members and | 222 operation_str not in keep_overloaded_members and |
| 222 operation_str not in overloaded_and_renamed and | 223 operation_str not in overloaded_and_renamed and |
| 223 operation_str not in renamed_html_members and | 224 operation_str not in renamed_html_members and |
| 224 operation_str not in private_html_members and | 225 operation_str not in private_html_members and |
| 225 operation_str not in removed_html_members and | 226 operation_str not in removed_html_members and |
| 226 operation.id != '__getter__' and | 227 operation.id != '__getter__' and |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 return self._type_registry.TypeInfo(type_name).narrow_dart_type() | 762 return self._type_registry.TypeInfo(type_name).narrow_dart_type() |
| 762 | 763 |
| 763 def _NarrowInputType(self, type_name): | 764 def _NarrowInputType(self, type_name): |
| 764 return self._NarrowToImplementationType(type_name) | 765 return self._NarrowToImplementationType(type_name) |
| 765 | 766 |
| 766 def _DartType(self, type_name): | 767 def _DartType(self, type_name): |
| 767 return self._type_registry.DartType(type_name) | 768 return self._type_registry.DartType(type_name) |
| 768 | 769 |
| 769 def _TypeInfo(self, type_name): | 770 def _TypeInfo(self, type_name): |
| 770 return self._type_registry.TypeInfo(type_name) | 771 return self._type_registry.TypeInfo(type_name) |
| OLD | NEW |