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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/lib/js_array.dart

Issue 11415067: Add annotations on native fields and methods (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comment Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/lib/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 _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
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 checkNull(length); // TODO(ahe): This is not specified but co19 tests it. 71 checkNull(length); // TODO(ahe): This is not specified but co19 tests it.
72 if (start is !int) throw new ArgumentError(start); 72 if (start is !int) throw new ArgumentError(start);
73 if (length is !int) throw new ArgumentError(length); 73 if (length is !int) throw new ArgumentError(length);
74 if (length < 0) throw new ArgumentError(length); 74 if (length < 0) throw new ArgumentError(length);
75 if (start < 0) throw new RangeError.value(start); 75 if (start < 0) throw new RangeError.value(start);
76 int end = start + length; 76 int end = start + length;
77 if (end > this.length) { 77 if (end > this.length) {
78 throw new RangeError.value(length); 78 throw new RangeError.value(length);
79 } 79 }
80 if (length < 0) throw new ArgumentError(length); 80 if (length < 0) throw new ArgumentError(length);
81 return JS('List', r'#.slice(#, #)', this, start, end); 81 return JS('=List', r'#.slice(#, #)', this, start, end);
82 } 82 }
83 83
84 void insertRange(int start, int length, [E initialValue]) { 84 void insertRange(int start, int length, [E initialValue]) {
85 return listInsertRange(this, start, length, initialValue); 85 return listInsertRange(this, start, length, initialValue);
86 } 86 }
87 87
88 E get last => this[length - 1]; 88 E get last => this[length - 1];
89 89
90 E get first => this[0]; 90 E get first => this[0];
91 91
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 bool get isEmpty => length == 0; 162 bool get isEmpty => length == 0;
163 163
164 String toString() => Collections.collectionToString(this); 164 String toString() => Collections.collectionToString(this);
165 165
166 ListIterator iterator() => new ListIterator(this); 166 ListIterator iterator() => new ListIterator(this);
167 167
168 int get hashCode => Primitives.objectHashCode(receiver); 168 int get hashCode => Primitives.objectHashCode(receiver);
169 169
170 Type get runtimeType => createRuntimeType('List'); 170 Type get runtimeType => createRuntimeType('List');
171 } 171 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698