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

Unified Diff: sdk/lib/_internal/compiler/js_lib/native_typed_data.dart

Issue 714873002: There are NativeTypedData classes that aren't lists and have no "length". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Dynamic to avoid warning. Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart b/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
index 7769b46b4923f3af8369eeae22b418905e6288e9..84b25bc52c1d630b83202a160314f1c34bb2b4ba 100644
--- a/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
+++ b/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
@@ -447,8 +447,11 @@ class NativeTypedData implements TypedData {
void _invalidIndex(int index, int length) {
if (index < 0 || index >= length) {
- if (length == this.length) {
- throw new RangeError.index(index, this);
+ if (this is List) {
+ var list = this; // Typed as dynamic to avoid warning.
+ if (length == list.length) {
+ throw new RangeError.index(index, this);
+ }
}
throw new RangeError.range(index, 0, length - 1);
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698