| 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 info.callback_args[1].is_optional else ''))), | 591 info.callback_args[1].is_optional else ''))), |
| 592 FUTURE_GENERIC = ('' if len(callback_info.param_infos) == 0 or | 592 FUTURE_GENERIC = ('' if len(callback_info.param_infos) == 0 or |
| 593 not callback_info.param_infos[0].type_id else | 593 not callback_info.param_infos[0].type_id else |
| 594 '<%s>' % self._DartType(callback_info.param_infos[0].type_id)), | 594 '<%s>' % self._DartType(callback_info.param_infos[0].type_id)), |
| 595 ORIGINAL_FUNCTION = html_name) | 595 ORIGINAL_FUNCTION = html_name) |
| 596 | 596 |
| 597 def EmitHelpers(self, base_class): | 597 def EmitHelpers(self, base_class): |
| 598 if not self._members_emitter: | 598 if not self._members_emitter: |
| 599 return | 599 return |
| 600 | 600 |
| 601 if (base_class != self.RootClassName() and | 601 if self._interface.id not in custom_html_constructors: |
| 602 self._interface.id not in custom_html_constructors): | |
| 603 self._members_emitter.Emit( | 602 self._members_emitter.Emit( |
| 604 ' // To suppress missing implicit constructor warnings.\n' | 603 ' // To suppress missing implicit constructor warnings.\n' |
| 605 ' factory $CLASSNAME._() { ' | 604 ' factory $CLASSNAME._() { ' |
| 606 'throw new UnsupportedError("Not supported"); }\n', | 605 'throw new UnsupportedError("Not supported"); }\n', |
| 607 CLASSNAME=self._interface_type_info.implementation_name()) | 606 CLASSNAME=self._interface_type_info.implementation_name()) |
| 608 | 607 |
| 609 def DeclareAttribute(self, attribute, type_name, attr_name, read_only): | 608 def DeclareAttribute(self, attribute, type_name, attr_name, read_only): |
| 610 """ Declares an attribute but does not include the code to invoke it. | 609 """ Declares an attribute but does not include the code to invoke it. |
| 611 """ | 610 """ |
| 612 if read_only: | 611 if read_only: |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 694 |
| 696 def SecureBaseName(self, type_name): | 695 def SecureBaseName(self, type_name): |
| 697 if type_name in _secure_base_types: | 696 if type_name in _secure_base_types: |
| 698 return _secure_base_types[type_name] | 697 return _secure_base_types[type_name] |
| 699 | 698 |
| 700 def _DartType(self, type_name): | 699 def _DartType(self, type_name): |
| 701 return self._type_registry.DartType(type_name) | 700 return self._type_registry.DartType(type_name) |
| 702 | 701 |
| 703 def _TypeInfo(self, type_name): | 702 def _TypeInfo(self, type_name): |
| 704 return self._type_registry.TypeInfo(type_name) | 703 return self._type_registry.TypeInfo(type_name) |
| OLD | NEW |