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

Side by Side Diff: tool/input_sdk/private/js_array.dart

Issue 1059583002: Extension method support to move us closer to a valid List implementation. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of _interceptors; 5 part of _interceptors;
6 6
7 /** 7 /**
8 * The interceptor class for [List]. The compiler recognizes this 8 * The interceptor class for [List]. The compiler recognizes this
9 * class as an interceptor, and changes references to [:this:] to 9 * class as an interceptor, and changes references to [:this:] to
10 * actually use the receiver of the method, which is generated as an extra 10 * actually use the receiver of the method, which is generated as an extra
11 * argument added to each member. 11 * argument added to each member.
12 */ 12 */
13 class JSArray<E> extends Interceptor implements List<E>, JSIndexable { 13 @JsName(name: 'Array')
14 class JSArray<E> implements List<E>, JSIndexable {
14 15
15 const JSArray(); 16 const JSArray();
16 17
17 /** 18 /**
18 * Returns a fresh JavaScript Array, marked as fixed-length. 19 * Returns a fresh JavaScript Array, marked as fixed-length.
19 * 20 *
20 * [length] must be a non-negative integer. 21 * [length] must be a non-negative integer.
21 */ 22 */
22 factory JSArray.fixed(int length) { 23 factory JSArray.fixed(int length) {
23 // Explicit type test is necessary to guard against JavaScript conversions 24 // Explicit type test is necessary to guard against JavaScript conversions
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 381 }
381 382
382 /** 383 /**
383 * Dummy subclasses that allow the backend to track more precise 384 * Dummy subclasses that allow the backend to track more precise
384 * information about arrays through their type. The CPA type inference 385 * information about arrays through their type. The CPA type inference
385 * relies on the fact that these classes do not override [] nor []=. 386 * relies on the fact that these classes do not override [] nor []=.
386 */ 387 */
387 class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {} 388 class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {}
388 class JSFixedArray<E> extends JSMutableArray<E> {} 389 class JSFixedArray<E> extends JSMutableArray<E> {}
389 class JSExtendableArray<E> extends JSMutableArray<E> {} 390 class JSExtendableArray<E> extends JSMutableArray<E> {}
OLDNEW
« tool/input_sdk/lib/core/list.dart ('K') | « tool/input_sdk/lib/core/list.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698