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

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

Issue 23499007: HTML types that don't have [] do not implement JavaScriptIndexingBehavior, that is, the items canno… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/systemhtml.py
===================================================================
--- tools/dom/scripts/systemhtml.py (revision 26906)
+++ tools/dom/scripts/systemhtml.py (working copy)
@@ -651,7 +651,7 @@
def AdditionalImplementedInterfaces(self):
implements = super(Dart2JSBackend, self).AdditionalImplementedInterfaces()
- if self._interface_type_info.list_item_type():
+ if self._interface_type_info.list_item_type() and self.HasIndexedGetter():
implements.append('JavaScriptIndexingBehavior')
return implements
@@ -718,6 +718,15 @@
self._current_secondary_parent = interface
self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id)
+ def HasIndexedGetter(self):
+ ext_attrs = self._interface.ext_attrs
+ has_indexed_getter = 'CustomIndexedGetter' in ext_attrs
+ for operation in self._interface.operations:
+ if operation.id == 'item' and 'getter' in operation.specials:
+ has_indexed_getter = True
+ break
+ return has_indexed_getter
+
def AddIndexer(self, element_type):
"""Adds all the methods required to complete implementation of List."""
# We would like to simply inherit the implementation of everything except
@@ -738,12 +747,7 @@
# class YImpl extends ListBase<T> { copies of transitive XImpl methods; }
#
- ext_attrs = self._interface.ext_attrs
- has_indexed_getter = 'CustomIndexedGetter' in ext_attrs
- for operation in self._interface.operations:
- if operation.id == 'item' and 'getter' in operation.specials:
- has_indexed_getter = True
- break
+ has_indexed_getter = self.HasIndexedGetter()
if has_indexed_getter:
indexed_getter = ('JS("%s", "#[#]", this, index)' %
« no previous file with comments | « sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ('k') | tools/dom/templates/html/dart2js/svg_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698