Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: tools/dom/scripts/systemhtml.py

Issue 12024002: Fixing cleanup of dart:html annotation generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/systemhtml.py
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index 465645dae12c30a4704c85a05e4785e0c30227f2..19c251e75c3fb2a0755cda878881e0c7f2d52fbe 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -394,15 +394,13 @@ class HtmlDartInterfaceGenerator(object):
if implements:
implements_str = ' implements ' + ', '.join(set(implements))
- annotations = FindCommonAnnotations(self._interface.doc_js_name)
- annotations_str = ''
- if annotations:
- annotations_str = '\n' + '\n'.join(annotations)
+ annotations = FormatAnnotations(
+ FindCommonAnnotations(self._interface.doc_js_name), '')
self._implementation_members_emitter = implementation_emitter.Emit(
self._backend.ImplementationTemplate(),
LIBRARYNAME=self._library_name,
- ANNOTATIONS=annotations_str,
+ ANNOTATIONS=annotations,
CLASSNAME=self._interface_type_info.implementation_name(),
EXTENDS=' extends %s' % base_class if base_class else '',
IMPLEMENTS=implements_str,
@@ -923,19 +921,20 @@ class Dart2JSBackend(HtmlDartGenerator):
return "@JSName('%s')\n " % idl_name
return ''
- def _Annotations(self, idl_type, idl_member_name):
- out = ''
- annotations = FindDart2JSAnnotations(idl_type, self._interface.id,
+ def _Annotations(self, idl_type, idl_member_name, indent=' '):
+ anns = FindDart2JSAnnotations(idl_type, self._interface.id,
idl_member_name)
- if annotations:
- out = '%s\n ' % annotations
+
if not AnyConversionAnnotations(idl_type, self._interface.id,
idl_member_name):
return_type = self.SecureOutputType(idl_type)
native_type = self._NarrowToImplementationType(idl_type)
if native_type != return_type:
- out += "@Returns('%s') @Creates('%s')\n " % (native_type, native_type)
- return out
+ anns = anns + [
+ "@Returns('%s')" % native_type,
+ "@Creates('%s')" % native_type,
+ ]
+ return FormatAnnotations(anns, indent);
def CustomJSMembers(self):
return _js_custom_members
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698