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

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

Issue 11962049: Revert "Fixing formatting of dart:html's dart2js annotations." (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 feda7d4498c5c2434af1672b3e7944130257f898..df952caad4e91f41952e9d1ece68cd3bcaedf9db 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -393,13 +393,15 @@ class HtmlDartInterfaceGenerator(object):
if implements:
implements_str = ' implements ' + ', '.join(set(implements))
- annotations = FormatAnnotations(
- FindCommonAnnotations(self._interface.doc_js_name), '')
+ annotations = FindCommonAnnotations(self._interface.doc_js_name)
+ annotations_str = ''
+ if annotations:
+ annotations_str = '\n' + '\n'.join(annotations)
self._implementation_members_emitter = implementation_emitter.Emit(
self._backend.ImplementationTemplate(),
LIBRARYNAME=self._library_name,
- ANNOTATIONS=annotations,
+ ANNOTATIONS=annotations_str,
CLASSNAME=self._interface_type_info.implementation_name(),
EXTENDS=' extends %s' % base_class if base_class else '',
IMPLEMENTS=implements_str,
@@ -920,20 +922,19 @@ class Dart2JSBackend(HtmlDartGenerator):
return "@JSName('%s')\n " % idl_name
return ''
- def _Annotations(self, idl_type, idl_member_name, indent=' '):
+ def _Annotations(self, idl_type, idl_member_name):
+ out = ''
annotations = 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:
- annotations.extend([
- "@Returns('%s')" % native_type,
- "@Creates('%s')" % native_type,
- ])
- return FormatAnnotations(annotations, indent);
+ out += "@Returns('%s') @Creates('%s')\n " % (native_type, native_type)
+ return out
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