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

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

Issue 14619013: Explicitly implementing some DOM iterable APIs for performance (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 | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/immutable_list_mixin.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/systemnative.py
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index 4c618543fa887244d899e1ac1c4c11827b56b8eb..2c955bdbecc796006746e69b3ecc22ee0e462f66 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -428,7 +428,12 @@ class DartiumBackend(HtmlDartGenerator):
else:
self._members_emitter.Emit(
'\n'
- ' $TYPE operator[](int index) native "$(INTERFACE)_item_Callback";\n',
+ ' $TYPE operator[](int index) {\n'
+ ' if (index < 0 || index >= length)\n'
+ ' throw new RangeError.range(index, 0, length);\n'
+ ' return _nativeIndexedGetter(index);\n'
+ ' }\n'
+ ' $TYPE _nativeIndexedGetter(int index) native "$(INTERFACE)_item_Callback";\n',
TYPE=self.SecureOutputType(element_type),
INTERFACE=self._interface.id)
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/immutable_list_mixin.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698