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

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

Issue 14036014: Updating DOM code to use list mixins (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index fb116d176b6c3dc67b0ee815a1acf9df9c225397..d493060aa083aefa7e21a411b31096f3bcbb5437 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -326,6 +326,17 @@ class HtmlDartGenerator(object):
implements.append('List<%s>' % item_type_info.dart_type())
return implements
+ def Mixins(self):
+ mixins = []
+ if self._interface_type_info.list_item_type():
+ item_type = self._type_registry.TypeInfo(
+ self._interface_type_info.list_item_type()).dart_type()
+ mixins.append('ListMixin<%s>' % item_type)
+ mixins.append('ImmutableListMixin<%s>' % item_type)
+
+ return mixins
+
+
def AddConstructors(self,
constructors, factory_name, factory_constructor_name):
""" Adds all of the constructors.
@@ -524,8 +535,6 @@ class HtmlDartGenerator(object):
# TODO(sra): Use separate mixins for mutable implementations of List<T>.
# TODO(sra): Use separate mixins for typed array implementations of List<T>.
template_file = 'immutable_list_mixin.darttemplate'
- has_contains = any(op.id == 'contains' for op in self._interface.operations)
- has_clear = any(op.id == 'clear' for op in self._interface.operations)
has_length = False
has_length_setter = False
@@ -540,8 +549,6 @@ class HtmlDartGenerator(object):
template = self._template_loader.Load(
template_file,
{
- 'DEFINE_CONTAINS': not has_contains,
- 'DEFINE_CLEAR': not has_clear,
'DEFINE_LENGTH_AS_NUM_ITEMS': not has_length and has_num_items,
'DEFINE_LENGTH_SETTER': not has_length_setter,
})
« no previous file with comments | « sdk/lib/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698