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

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

Issue 1348453004: fix some errors in our SDK, mostly around numbers (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « tool/input_sdk/patch/typed_data_patch.dart ('k') | tool/input_sdk/private/js_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dart._interceptors; 5 part of dart._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
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 if (!growable) markFixedList(list); 291 if (!growable) markFixedList(list);
292 return new JSArray<E>.typed(list); 292 return new JSArray<E>.typed(list);
293 } 293 }
294 294
295 Set<E> toSet() => new Set<E>.from(this); 295 Set<E> toSet() => new Set<E>.from(this);
296 296
297 Iterator<E> get iterator => new ListIterator<E>(this); 297 Iterator<E> get iterator => new ListIterator<E>(this);
298 298
299 int get hashCode => Primitives.objectHashCode(this); 299 int get hashCode => Primitives.objectHashCode(this);
300 300
301 int get length => JS('JSUInt32', r'#.length', this); 301 int get length => JS('int', r'#.length', this);
302 302
303 void set length(int newLength) { 303 void set length(int newLength) {
304 if (newLength is !int) throw new ArgumentError(newLength); 304 if (newLength is !int) throw new ArgumentError(newLength);
305 if (newLength < 0) throw new RangeError.value(newLength); 305 if (newLength < 0) throw new RangeError.value(newLength);
306 checkGrowable('set length'); 306 checkGrowable('set length');
307 JS('void', r'#.length = #', this, newLength); 307 JS('void', r'#.length = #', this, newLength);
308 } 308 }
309 309
310 E operator [](int index) { 310 E operator [](int index) {
311 if (index is !int) throw new ArgumentError(index); 311 if (index is !int) throw new ArgumentError(index);
(...skipping 13 matching lines...) Expand all
325 } 325 }
326 326
327 /** 327 /**
328 * Dummy subclasses that allow the backend to track more precise 328 * Dummy subclasses that allow the backend to track more precise
329 * information about arrays through their type. The CPA type inference 329 * information about arrays through their type. The CPA type inference
330 * relies on the fact that these classes do not override [] nor []=. 330 * relies on the fact that these classes do not override [] nor []=.
331 */ 331 */
332 class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {} 332 class JSMutableArray<E> extends JSArray<E> implements JSMutableIndexable {}
333 class JSFixedArray<E> extends JSMutableArray<E> {} 333 class JSFixedArray<E> extends JSMutableArray<E> {}
334 class JSExtendableArray<E> extends JSMutableArray<E> {} 334 class JSExtendableArray<E> extends JSMutableArray<E> {}
OLDNEW
« no previous file with comments | « tool/input_sdk/patch/typed_data_patch.dart ('k') | tool/input_sdk/private/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698