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

Unified Diff: lib/html/scripts/generator.py

Issue 11030027: Remove global DartType function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « no previous file | lib/html/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/generator.py
diff --git a/lib/html/scripts/generator.py b/lib/html/scripts/generator.py
index fe618dae44d9cb6c4e310795bb8b3f504576d731..f0b1ca0cd8b4135b63f12d49ca80a55e4e7e2fcd 100644
--- a/lib/html/scripts/generator.py
+++ b/lib/html/scripts/generator.py
@@ -141,12 +141,6 @@ def MatchSourceFilter(thing):
return 'WebKit' in thing.annotations or 'Dart' in thing.annotations
-def DartType(idl_type_name):
- if idl_type_name in _idl_type_registry:
- return _idl_type_registry[idl_type_name].dart_type or idl_type_name
- return idl_type_name
-
-
class ParamInfo(object):
"""Holder for various information about a parameter of a Dart operation.
@@ -187,11 +181,15 @@ def _BuildArguments(args, interface, constructor=False):
def OverloadedName(args):
return '_OR_'.join(sorted(set(arg.id for arg in args)))
+ def DartType(idl_type_name):
+ if idl_type_name in _idl_type_registry:
+ return _idl_type_registry[idl_type_name].dart_type or idl_type_name
+ return idl_type_name
+
# Given a list of overloaded arguments, choose a suitable type.
def OverloadedType(args):
type_ids = sorted(set(arg.type.id for arg in args))
- dart_types = sorted(set(DartType(arg.type.id) for arg in args))
- if len(dart_types) == 1:
+ if len(set(DartType(arg.type.id) for arg in args)) == 1:
if len(type_ids) == 1:
return (type_ids[0], type_ids[0])
else:
« no previous file with comments | « no previous file | lib/html/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698