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

Unified Diff: frog/lib/corelib_impl.dart

Issue 8725007: Lots of stuff hooking up markdown to dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to awesome reviews. Created 9 years, 1 month 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 | utils/dartdoc/README.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/lib/corelib_impl.dart
diff --git a/frog/lib/corelib_impl.dart b/frog/lib/corelib_impl.dart
index 4cee364e97e1f427dd7e6b8a0eae949f8011d04a..b96ab900d5e7c64bb513e97ed43edbdf183659e5 100644
--- a/frog/lib/corelib_impl.dart
+++ b/frog/lib/corelib_impl.dart
@@ -68,8 +68,19 @@ class ListFactory<E> implements List<E> native "Array" {
"return this.slice(start, start + length);";
void setRange(int start, int length, List<E> from, [int startFrom]) native;
- void removeRange(int start, int length) native;
- void insertRange(int start, int length, [E initialValue]) native;
+ void removeRange(int start, int length) native "this.splice(start, length);";
+
+ void insertRange(int start, int length, [E initialValue]) native
+ """
+ // Splice in the values with a minimum of array allocations.
+ var args = new Array(length + 2);
+ args[0] = start;
+ args[1] = 0;
+ for (var i = 0; i < length; i++) {
+ args[i + 2] = initialValue;
+ }
+ this.splice.apply(this, args);
+ """;
// Collection<E> members:
void forEach(void f(E element)) native;
« no previous file with comments | « no previous file | utils/dartdoc/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698