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

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

Issue 11887006: Changed @domName annotation in comment to full fledge @DomName annotation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged and stuff.' 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
Index: tools/dom/scripts/generator.py
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index d1d8cd9c011774286f00c63927c5c959468dc87d..0183e7395f8ff8f9c23d579460b62968ef5d863a 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -717,10 +717,17 @@ dart_annotations = {
def FindCommonAnnotations(interface_name, member_name=None):
""" Finds annotations common between dart2js and dartium.
"""
+ annotations = []
if member_name:
- return dart_annotations.get('%s.%s' % (interface_name, member_name))
+ key = '%s.%s' % (interface_name, member_name)
else:
- return dart_annotations.get(interface_name)
+ key = interface_name
+
+ annotations.append('@DomName("' + key + '")')
blois 2013/01/12 01:21:29 how about annotations = ['@DomName("' + key + '")'
Andrei Mouravski 2013/01/14 22:56:46 Done.
blois 2013/01/15 22:26:32 Undone?
Andrei Mouravski 2013/01/16 00:24:25 I'm confused. What's wrong here?
+ if (dart_annotations.get(key) != None):
+ annotations.extend(dart_annotations.get(key))
+
+ return annotations
def FindDart2JSAnnotations(idl_type, interface_name, member_name):
""" Finds all annotations for Dart2JS members- including annotations for
@@ -738,6 +745,13 @@ def FindDart2JSAnnotations(idl_type, interface_name, member_name):
annotations = ann2
return annotations
+def AnySpecificAnnotations(idl_type, interface_name, member_name):
+ if (dart_annotations.get('%s.%s' % (interface_name, member_name)) or
+ _FindDart2JSSpecificAnnotations(idl_type, interface_name, member_name)):
+ return True
+ else:
+ return False
+
def _FindDart2JSSpecificAnnotations(idl_type, interface_name, member_name):
""" Finds dart2js-specific annotations. This does not include ones shared with
dartium.

Powered by Google App Engine
This is Rietveld 408576698