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 from generator import AnalyzeOperation, ConstantOutputOrder, \ | 9 from generator import AnalyzeOperation, ConstantOutputOrder, \ |
| 10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \ | 10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \ |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 self._database = options.database | 26 self._database = options.database |
| 27 self._interface = interface | 27 self._interface = interface |
| 28 self._type_registry = options.type_registry | 28 self._type_registry = options.type_registry |
| 29 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) | 29 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) |
| 30 self._renamer = options.renamer | 30 self._renamer = options.renamer |
| 31 | 31 |
| 32 def EmitSupportCheck(self): | 32 def EmitSupportCheck(self): |
| 33 if self.HasSupportCheck(): | 33 if self.HasSupportCheck(): |
| 34 support_check = self.GetSupportCheck() | 34 support_check = self.GetSupportCheck() |
| 35 self._members_emitter.Emit('\n' | 35 self._members_emitter.Emit('\n' |
| 36 ' /**\n' | 36 ' /// Checks if this type is supported on the current platform.\n' |
|
Emily Fortuna
2013/01/11 21:40:10
I know I suggested /** stuff */, but if you're goi
| |
| 37 ' * Checks if this type is supported on the current platform\n' | |
| 38 ' */\n' | |
| 39 ' static bool get supported => $SUPPORT_CHECK;\n', | 37 ' static bool get supported => $SUPPORT_CHECK;\n', |
| 40 SUPPORT_CHECK=support_check) | 38 SUPPORT_CHECK=support_check) |
| 41 | 39 |
| 42 def EmitAttributeDocumentation(self, attribute): | 40 def EmitAttributeDocumentation(self, attribute): |
| 43 """ Emits the MDN dartdoc comment for an attribute. | 41 """ Emits the MDN dartdoc comment for an attribute. |
| 44 """ | 42 """ |
| 45 dom_name = DartDomNameOfAttribute(attribute) | 43 dom_name = DartDomNameOfAttribute(attribute) |
| 46 self._members_emitter.Emit('\n /// @domName $DOMINTERFACE.$DOMNAME;' | 44 self._members_emitter.Emit('\n /// @domName $DOMINTERFACE.$DOMNAME;' |
| 47 ' @docsEditable true', | 45 ' @docsEditable true', |
| 48 DOMINTERFACE=attribute.doc_js_interface_name, | 46 DOMINTERFACE=attribute.doc_js_interface_name, |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 walk(interface.parents) | 462 walk(interface.parents) |
| 465 else: | 463 else: |
| 466 walk(interface.parents[1:]) | 464 walk(interface.parents[1:]) |
| 467 return result | 465 return result |
| 468 | 466 |
| 469 def _DartType(self, type_name): | 467 def _DartType(self, type_name): |
| 470 return self._type_registry.DartType(type_name) | 468 return self._type_registry.DartType(type_name) |
| 471 | 469 |
| 472 def _IsPrivate(self, name): | 470 def _IsPrivate(self, name): |
| 473 return name.startswith('_') | 471 return name.startswith('_') |
| OLD | NEW |