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

Unified Diff: sdk/lib/_internal/lib/js_primitives.dart

Issue 75703002: Revert "This change makes it easier to put type parameters on JavaScript Arrays." (Closed) Base URL: https://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 | « sdk/lib/_internal/lib/js_names.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_primitives.dart
diff --git a/sdk/lib/_internal/lib/js_primitives.dart b/sdk/lib/_internal/lib/js_primitives.dart
index 3315040636019394590ae862bc595a16975ce4a6..86a405eb2918b94f6ebfc910db87bf4e9d2dd0b3 100644
--- a/sdk/lib/_internal/lib/js_primitives.dart
+++ b/sdk/lib/_internal/lib/js_primitives.dart
@@ -9,6 +9,10 @@ library dart2js._js_primitives;
import 'dart:_foreign_helper' show
JS;
+import 'dart:_interceptors' show
+ JSExtendableArray,
+ JSFixedArray;
+
/**
* This is the low-level method that is used to implement [print]. It is
* possible to override this function from JavaScript by defining a function in
@@ -48,3 +52,16 @@ void printString(String string) {
// avoid using Dart [:throw:] and Dart [toString].
JS('void', 'throw "Unable to print message: " + String(#)', string);
}
+
+List newGrowableList(length) {
+ return JS('JSExtendableArray', r'new Array(#)', length);
+}
+
+List newFixedList(length) {
+ return markFixedList(JS('', r'new Array(#)', length));
+}
+
+List markFixedList(List list) {
+ JS('void', r'#.fixed$length = #', list, true);
+ return JS('JSFixedArray', '#', list);
+}
« no previous file with comments | « sdk/lib/_internal/lib/js_names.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698