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

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

Issue 12025035: Adding annotations to event streams. (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 | « sdk/lib/web_audio/dartium/web_audio_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/htmleventgenerator.py
diff --git a/tools/dom/scripts/htmleventgenerator.py b/tools/dom/scripts/htmleventgenerator.py
index 10aaca0aad6a8213768cfb8408dd6205a0721b6f..ec964e19ca77ca268b94d06e4ce9ae0715e5bff3 100644
--- a/tools/dom/scripts/htmleventgenerator.py
+++ b/tools/dom/scripts/htmleventgenerator.py
@@ -6,6 +6,7 @@
"""This module provides functionality to generate dart:html event classes."""
import logging
+from generator import FindCommonAnnotations, FormatAnnotations
_logger = logging.getLogger('dartgenerator')
@@ -393,10 +394,14 @@ class HtmlEventGenerator(object):
if self._GetEventRedirection(interface, html_name, event_type):
continue
+ annotations = FormatAnnotations(
+ FindCommonAnnotations(interface.id, dom_name), ' ')
+
members_emitter.Emit(
"\n"
- " static const EventStreamProvider<$TYPE> $(NAME)Event = "
- "const EventStreamProvider<$TYPE>('$DOM_NAME');\n",
+ " $(ANNOTATIONS)static const EventStreamProvider<$TYPE> "
+ "$(NAME)Event = const EventStreamProvider<$TYPE>('$DOM_NAME');\n",
+ ANNOTATIONS=annotations,
NAME=html_name,
DOM_NAME=dom_name,
TYPE=event_type)
@@ -418,9 +423,14 @@ class HtmlEventGenerator(object):
else:
provider = html_name + 'Event'
+ annotations = FormatAnnotations(
+ FindCommonAnnotations(interface.id, dom_name), ' ')
+
members_emitter.Emit(
"\n"
- " Stream<$TYPE> get $(NAME) => $PROVIDER.forTarget(this);\n",
+ " $(ANNOTATIONS)Stream<$TYPE> get $(NAME) => "
+ "$PROVIDER.forTarget(this);\n",
+ ANNOTATIONS=annotations,
NAME=getter_name,
PROVIDER=provider,
TYPE=event_type)
« no previous file with comments | « sdk/lib/web_audio/dartium/web_audio_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698