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

Unified Diff: sdk/lib/_internal/lib/js_helper.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/_internal/lib/js_array.dart ('k') | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_helper.dart
===================================================================
--- sdk/lib/_internal/lib/js_helper.dart (revision 24309)
+++ sdk/lib/_internal/lib/js_helper.dart (working copy)
@@ -36,10 +36,6 @@
part 'string_helper.dart';
part 'js_rti.dart';
-bool isJsArray(var value) {
- return value != null && JS('bool', r'(#.constructor === Array)', value);
-}
-
bool isJsIndexable(var object, var record) {
if (record != null) {
var result = dispatchRecordIndexability(record);
@@ -155,7 +151,7 @@
// to be a JavaScript object with intercepted names as property
// instead of a JavaScript array.
if (JS('int', '#.indexOf(#)', interceptedNames, name) == -1) {
- if (!isJsArray(arguments)) arguments = new List.from(arguments);
+ if (arguments is! JSArray) arguments = new List.from(arguments);
} else {
arguments = [object]..addAll(arguments);
receiver = interceptor;
@@ -230,7 +226,7 @@
if (handleError == null) handleError = _throwFormatException;
checkString(source);
- var match = JS('=List|Null',
+ var match = JS('JSExtendableArray|Null',
r'/^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(#)',
source);
int digitsIndex = 1;
@@ -353,11 +349,11 @@
}
static List newGrowableList(length) {
- return JS('=List', r'new Array(#)', length);
+ return JS('JSExtendableArray', r'new Array(#)', length);
}
static List newFixedList(length) {
- var result = JS('=List', r'new Array(#)', length);
+ var result = JS('JSFixedArray', r'new Array(#)', length);
JS('void', r'#.fixed$length = #', result, true);
return result;
}
@@ -386,7 +382,7 @@
if (end <= kMaxApply) {
subarray = array;
} else {
- subarray = JS('=List', r'#.slice(#, #)', array,
+ subarray = JS('JSExtendableArray', r'#.slice(#, #)', array,
i, i + kMaxApply < end ? i + kMaxApply : end);
}
result = JS('String', '# + String.fromCharCode.apply(#, #)',
@@ -1056,9 +1052,6 @@
* one or more types, separated by vertical bars `|`. There are some special
* names:
*
- * * `=List`. This means 'exactly List', which is the JavaScript Array
- * implementation of [List] and no other implementation.
- *
* * `=Object`. This means 'exactly Object', which is a plain JavaScript object
* with properties and none of the subtypes of Object.
*
@@ -1093,11 +1086,11 @@
*
* Example: IndexedDB keys are numbers, strings and JavaScript Arrays of keys.
*
- * @Returns('String|num|=List')
+ * @Returns('String|num|JSExtendableArray')
* dynamic key;
*
* // Equivalent:
- * @Returns('String') @Returns('num') @Returns('=List')
+ * @Returns('String') @Returns('num') @Returns('JSExtendableArray')
* dynamic key;
*/
class Returns {
« no previous file with comments | « sdk/lib/_internal/lib/js_array.dart ('k') | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698