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

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
Index: tools/dom/scripts/systemnative.py
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index bbd9be37b82fc11bf06ef664c1e756ed1c4d9b07..51e578e22c6eb97c622249bb431715010fbda7e4 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -428,7 +428,11 @@ class DartiumBackend(HtmlDartGenerator):
else:
self._members_emitter.Emit(
'\n'
- ' $TYPE operator[](int index) native "$(INTERFACE)_item_Callback";\n',
+ ' $TYPE operator[](int index) {\n'
sra1 2013/05/09 19:55:50 Does the native code to a bounds check?
blois 2013/05/09 20:00:25 It appears to have the same behavior as JS.
+ ' if (index < 0 || index >= length) throw new RangeError.range(index, 0, length);\n'
sra1 2013/05/09 19:55:50 line length
blois 2013/05/09 22:49:24 Done.
+ ' return _nativeIndexedGetter(index);\n'
+ ' }\n'
+ ' $TYPE _nativeIndexedGetter(int index) native "$(INTERFACE)_item_Callback";\n',
TYPE=self.SecureOutputType(element_type),
INTERFACE=self._interface.id)

Powered by Google App Engine
This is Rietveld 408576698