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

Unified Diff: sdk/lib/typed_data/dart2js/typed_data_dart2js.dart

Issue 76003004: Fix http://code.google.com/p/dart/issues/detail?id=15133. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | tests/lib/typed_data/typed_data_from_list_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
===================================================================
--- sdk/lib/typed_data/dart2js/typed_data_dart2js.dart (revision 30389)
+++ sdk/lib/typed_data/dart2js/typed_data_dart2js.dart (working copy)
@@ -10,7 +10,9 @@
import 'dart:collection';
import 'dart:_collection-dev';
-import 'dart:_js_helper' show Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
+import 'dart:_interceptors' show JSIndexable;
+import 'dart:_js_helper'
+ show Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
import 'dart:_foreign_helper' show JS, JS_CONST;
import 'dart:math' as Math;
@@ -119,7 +121,12 @@
// Ensures that [list] is a JavaScript Array or a typed array. If necessary,
// returns a copy of the list.
List _ensureNativeList(List list) {
- return list; // TODO: make sure.
+ if (list is JSIndexable) return list;
+ List result = new List(list.length);
+ for (int i = 0; i < list.length; i++) {
+ result[i] = list[i];
+ }
+ return result;
}
« no previous file with comments | « no previous file | tests/lib/typed_data/typed_data_from_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698