| 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 logging | 10 import logging |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 infos = ElementConstructorInfos(self._interface.id, | 505 infos = ElementConstructorInfos(self._interface.id, |
| 506 _element_constructors[self._library_name], factory_provider_name= | 506 _element_constructors[self._library_name], factory_provider_name= |
| 507 _factory_ctr_strings[self._library_name]['provider_name']) | 507 _factory_ctr_strings[self._library_name]['provider_name']) |
| 508 | 508 |
| 509 if infos: | 509 if infos: |
| 510 factory_constructor_name = _factory_ctr_strings[ | 510 factory_constructor_name = _factory_ctr_strings[ |
| 511 self._library_name]['constructor_name'] | 511 self._library_name]['constructor_name'] |
| 512 | 512 |
| 513 for info in infos: | 513 for info in infos: |
| 514 constructors.append(info.ConstructorInfo(self._interface.id)) | 514 constructors.append(info.ConstructorInfo(self._interface.id)) |
| 515 if factory_provider: | 515 if factory_provider and factory_provider != info.factory_provider_name: |
| 516 assert factory_provider == info.factory_provider_name | 516 _logger.warn('Conflicting factory provider names: %s != %s' % |
| 517 else: | 517 (factory_provider, info.factory_provider_name)) |
| 518 factory_provider = info.factory_provider_name | 518 factory_provider = info.factory_provider_name |
| 519 | 519 |
| 520 implementation_emitter = self._ImplementationEmitter() | 520 implementation_emitter = self._ImplementationEmitter() |
| 521 | 521 |
| 522 base_type_info = None | 522 base_type_info = None |
| 523 if self._interface.parents: | 523 if self._interface.parents: |
| 524 supertype = self._interface.parents[0].type.id | 524 supertype = self._interface.parents[0].type.id |
| 525 if not IsDartCollectionType(supertype) and not IsPureInterface(supertype): | 525 if not IsDartCollectionType(supertype) and not IsPureInterface(supertype): |
| 526 base_type_info = self._type_registry.TypeInfo(supertype) | 526 base_type_info = self._type_registry.TypeInfo(supertype) |
| 527 | 527 |
| 528 if base_type_info: | 528 if base_type_info: |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 for library_name in libraries: | 1241 for library_name in libraries: |
| 1242 self._libraries[library_name] = DartLibrary( | 1242 self._libraries[library_name] = DartLibrary( |
| 1243 library_name, template_loader, library_type, output_dir) | 1243 library_name, template_loader, library_type, output_dir) |
| 1244 | 1244 |
| 1245 def AddFile(self, basename, library_name, path): | 1245 def AddFile(self, basename, library_name, path): |
| 1246 self._libraries[library_name].AddFile(path) | 1246 self._libraries[library_name].AddFile(path) |
| 1247 | 1247 |
| 1248 def Emit(self, emitter, auxiliary_dir): | 1248 def Emit(self, emitter, auxiliary_dir): |
| 1249 for lib in self._libraries.values(): | 1249 for lib in self._libraries.values(): |
| 1250 lib.Emit(emitter, auxiliary_dir) | 1250 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |