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

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

Issue 10823140: Make more native DOM array-like objects known to compiler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: indentation Created 8 years, 5 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/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/systemhtml.py
diff --git a/lib/dom/scripts/systemhtml.py b/lib/dom/scripts/systemhtml.py
index 90853dd8aac54924e0639798eb0ab77f4a8304a3..4d0d8f4698a60455ca6d44a78d5e589df70342e1 100644
--- a/lib/dom/scripts/systemhtml.py
+++ b/lib/dom/scripts/systemhtml.py
@@ -806,6 +806,8 @@ class HtmlDart2JSClassGenerator(Dart2JSInterfaceGenerator):
element_type = MaybeTypedArrayElementType(self._interface)
if element_type:
implements.append('List<%s>' % self._DartType(element_type))
+
+ if self._HasJavaScriptIndexingBehaviour():
implements.append('JavaScriptIndexingBehavior')
template_file = 'impl_%s.darttemplate' % self._html_interface_name
@@ -999,6 +1001,13 @@ class HtmlDart2JSClassGenerator(Dart2JSInterfaceGenerator):
member_name = '%s.%s' % (self._html_interface_name, member_name)
return member_name in _js_custom_members
+ def _HasJavaScriptIndexingBehaviour(self):
+ """Returns True if the native object has an indexer and length property."""
+ (element_type, requires_indexer) = ListImplementationInfo(
+ self._interface, self._database)
+ if element_type and requires_indexer: return True
+ return False
+
# ------------------------------------------------------------------------------
class HtmlDart2JSSystem(System):
« no previous file with comments | « no previous file | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698