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

Side by Side Diff: test/dart_codegen/expect/_internal/lists.dart

Issue 1148283010: Remove dart backend (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 part of dart._internal;
2 class Lists {static void copy(List src, int srcStart, List dst, int dstStart, i nt count) {
3 if (srcStart < dstStart) {
4 for (int i = srcStart + count - 1, j = dstStart + count - 1; i >= srcStart; i--, j--) {
5 dst[j] = src[i];
6 }
7 }
8 else {
9 for (int i = srcStart, j = dstStart; i < srcStart + count; i++, j++) {
10 dst[j] = src[i];
11 }
12 }
13 }
14 static bool areEqual(List a, var b) {
15 if (identical(a, b)) return true;
16 if (!(b is List)) return false;
17 int length = a.length;
18 if (length != b.length) return false;
19 for (int i = 0; i < length; i++) {
20 if (!identical(a[i], b[i])) return false;
21 }
22 return true;
23 }
24 static int indexOf(List a, Object element, int startIndex, int endIndex) {
25 if (startIndex >= a.length) {
26 return -1;
27 }
28 if (startIndex < 0) {
29 startIndex = 0;
30 }
31 for (int i = startIndex; i < endIndex; i++) {
32 if (a[i] == element) {
33 return i;
34 }
35 }
36 return -1;
37 }
38 static int lastIndexOf(List a, Object element, int startIndex) {
39 if (startIndex < 0) {
40 return -1;
41 }
42 if (startIndex >= a.length) {
43 startIndex = a.length - 1;
44 }
45 for (int i = startIndex; i >= 0; i--) {
46 if (a[i] == element) {
47 return i;
48 }
49 }
50 return -1;
51 }
52 static void indicesCheck(List a, int start, int end) {
53 RangeError.checkValidRange(start, end, a.length);
54 }
55 static void rangeCheck(List a, int start, int length) {
56 RangeError.checkNotNegative(length);
57 RangeError.checkNotNegative(start);
58 if (start + length > a.length) {
59 String message = "$start + $length must be in the range [0..${a.length}]";
60 throw new RangeError.range(length, 0, a.length - start, "length", message);
61 }
62 }
63 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/_internal/list.dart ('k') | test/dart_codegen/expect/_internal/print.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698