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

Unified Diff: sdk/lib/html/html_common/conversions.dart

Issue 17301008: Remove =List in JS, use JSExtendableArray instead. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/html_common/html_common_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/html_common/conversions.dart
===================================================================
--- sdk/lib/html/html_common/conversions.dart (revision 24309)
+++ sdk/lib/html/html_common/conversions.dart (working copy)
@@ -34,7 +34,8 @@
Map convertNativeToDart_Dictionary(object) {
if (object == null) return null;
var dict = {};
- for (final key in JS('=List', 'Object.getOwnPropertyNames(#)', object)) {
+ var keys = JS('JSExtendableArray', 'Object.getOwnPropertyNames(#)', object);
+ for (final key in keys) {
dict[key] = JS('var', '#[#]', object, key);
}
return dict;
@@ -165,7 +166,7 @@
var copy = readSlot(slot);
if (copy != null) {
if (true == copy) { // Cycle, so commit to making a copy.
- copy = JS('=List', 'new Array(#)', length);
+ copy = JS('JSExtendableArray', 'new Array(#)', length);
writeSlot(slot, copy);
}
return copy;
@@ -175,7 +176,7 @@
// Always clone the list, as it may have non-native properties or methods
// from interceptors and such.
- copy = JS('=List', 'new Array(#)', length);
+ copy = JS('JSExtendableArray', 'new Array(#)', length);
writeSlot(slot, copy);
for ( ; i < length; i++) {
@@ -254,7 +255,7 @@
copy = {};
writeSlot(slot, copy);
- for (final key in JS('=List', 'Object.keys(#)', e)) {
+ for (final key in JS('JSExtendableArray', 'Object.keys(#)', e)) {
copy[key] = walk(JS('var', '#[#]', e, key));
}
return copy;
@@ -268,7 +269,7 @@
int length = e.length;
// Since a JavaScript Array is an instance of Dart List, we can modify it
// in-place unless we must copy.
- copy = mustCopy ? JS('=List', 'new Array(#)', length) : e;
+ copy = mustCopy ? JS('JSExtendableArray', 'new Array(#)', length) : e;
writeSlot(slot, copy);
for (int i = 0; i < length; i++) {
@@ -342,7 +343,7 @@
const String _serializedScriptValue =
'num|String|bool|'
- '=List|=Object|'
+ 'JSExtendableArray|=Object|'
'Blob|File|ByteBuffer|TypedData'
// TODO(sra): Add Date, RegExp.
;
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/html_common/html_common_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698