| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 for constructor_info in constructors: | 350 for constructor_info in constructors: |
| 351 self._AddConstructor( | 351 self._AddConstructor( |
| 352 constructor_info, factory_name, factory_constructor_name) | 352 constructor_info, factory_name, factory_constructor_name) |
| 353 | 353 |
| 354 def _AddConstructor(self, | 354 def _AddConstructor(self, |
| 355 constructor_info, factory_name, factory_constructor_name): | 355 constructor_info, factory_name, factory_constructor_name): |
| 356 if self.GenerateCustomFactory(constructor_info): | 356 if self.GenerateCustomFactory(constructor_info): |
| 357 return | 357 return |
| 358 | 358 |
| 359 metadata = self._metadata.GetFormattedMetadata( | 359 metadata = self._metadata.GetFormattedMetadata( |
| 360 self._library_name, self._interface.id, self._interface.id, ' ') | 360 self._library_name, self._interface, self._interface.id, ' ') |
| 361 | 361 |
| 362 if not factory_constructor_name: | 362 if not factory_constructor_name: |
| 363 factory_constructor_name = '_create' | 363 factory_constructor_name = '_create' |
| 364 factory_parameters = constructor_info.ParametersAsArgumentList() | 364 factory_parameters = constructor_info.ParametersAsArgumentList() |
| 365 has_factory_provider = True | 365 has_factory_provider = True |
| 366 else: | 366 else: |
| 367 factory_parameters = ', '.join(constructor_info.factory_parameters) | 367 factory_parameters = ', '.join(constructor_info.factory_parameters) |
| 368 has_factory_provider = False | 368 has_factory_provider = False |
| 369 | 369 |
| 370 if constructor_info.pure_dart_constructor: | 370 if constructor_info.pure_dart_constructor: |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 if interface.parents: | 597 if interface.parents: |
| 598 parent = interface.parents[0] | 598 parent = interface.parents[0] |
| 599 if IsPureInterface(parent.type.id): | 599 if IsPureInterface(parent.type.id): |
| 600 walk(interface.parents) | 600 walk(interface.parents) |
| 601 else: | 601 else: |
| 602 walk(interface.parents[1:]) | 602 walk(interface.parents[1:]) |
| 603 return result | 603 return result |
| 604 | 604 |
| 605 def _DartType(self, type_name): | 605 def _DartType(self, type_name): |
| 606 return self._type_registry.DartType(type_name) | 606 return self._type_registry.DartType(type_name) |
| OLD | NEW |