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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_array.dart

Issue 12335131: Make List.from default to not growable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix one more from. Created 7 years, 10 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: sdk/lib/_internal/compiler/implementation/lib/js_array.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
index 891e202b9caba4687ec91490d2caaf9a48b1f4e1..eed89a744c9eb2a2ddca385cdf4f1542e2ad64c0 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -155,6 +155,7 @@ class JSArray<E> implements List<E> {
}
void insertRange(int start, int length, [E initialValue]) {
+ checkGrowable(this, 'insertRange');
return listInsertRange(this, start, length, initialValue);
}
@@ -271,9 +272,9 @@ class JSArray<E> implements List<E> {
int get length => JS('int', r'#.length', this);
void set length(int newLength) {
+ checkGrowable(this, 'set length');
if (newLength is !int) throw new ArgumentError(newLength);
if (newLength < 0) throw new RangeError.value(newLength);
- checkGrowable(this, 'set length');
JS('void', r'#.length = #', this, newLength);
}
« no previous file with comments | « samples/third_party/dromaeo/Suites.dart ('k') | sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698