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

Unified Diff: compiler/lib/implementation/array.js

Issue 8271029: Implement List.insertRange. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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 | « compiler/lib/implementation/array.dart ('k') | compiler/lib/implementation/arrays.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/lib/implementation/array.js
===================================================================
--- compiler/lib/implementation/array.js (revision 424)
+++ compiler/lib/implementation/array.js (working copy)
@@ -41,6 +41,14 @@
native__ArrayJsUtil__throwIndexOutOfRangeException(index);
}
-function native_ObjectArray__splice(start, length) {
+function native_ObjectArray__removeRange(start, length) {
this.splice(start, length);
}
+
+function native_ObjectArray__insertRange(start, length, initialValue) {
+ var array = [start, 0];
+ for (var i = 0; i < length; i++){
+ array.push(initialValue);
+ }
+ this.splice.apply(this, array);
+}
« no previous file with comments | « compiler/lib/implementation/array.dart ('k') | compiler/lib/implementation/arrays.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698