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

Side by Side Diff: lib/runtime/dart/_internal.js

Issue 1148333003: No dynamic at runtime (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 5 years, 7 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 var _internal = dart.defineLibrary(_internal, {}); 1 var _internal = dart.defineLibrary(_internal, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var collection = dart.import(collection); 3 var collection = dart.import(collection);
4 var math = dart.lazyImport(math); 4 var math = dart.lazyImport(math);
5 var _interceptors = dart.lazyImport(_interceptors); 5 var _interceptors = dart.lazyImport(_interceptors);
6 var _js_primitives = dart.lazyImport(_js_primitives); 6 var _js_primitives = dart.lazyImport(_js_primitives);
7 (function(exports, core, collection, math, _interceptors, _js_primitives) { 7 (function(exports, core, collection, math, _interceptors, _js_primitives) {
8 'use strict'; 8 'use strict';
9 class EfficientLength extends core.Object {} 9 class EfficientLength extends core.Object {}
10 let ListIterable$ = dart.generic(function(E) { 10 let ListIterable$ = dart.generic(function(E) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 } 166 }
167 return dart.toString(buffer); 167 return dart.toString(buffer);
168 } 168 }
169 } 169 }
170 [core.$where](test) { 170 [core.$where](test) {
171 dart.as(test, dart.functionType(core.bool, [E])); 171 dart.as(test, dart.functionType(core.bool, [E]));
172 return super[core.$where](test); 172 return super[core.$where](test);
173 } 173 }
174 [core.$map](f) { 174 [core.$map](f) {
175 dart.as(f, dart.functionType(dart.dynamic, [E])); 175 dart.as(f, dart.functionType(core.Object, [E]));
176 return new MappedListIterable(this, f); 176 return new MappedListIterable(this, f);
177 } 177 }
178 [core.$reduce](combine) { 178 [core.$reduce](combine) {
179 dart.as(combine, dart.functionType(E, [dart.dynamic, E])); 179 dart.as(combine, dart.functionType(E, [dart.bottom, E]));
180 let length = this[core.$length]; 180 let length = this[core.$length];
181 if (length == 0) 181 if (length == 0)
182 throw IterableElementError.noElement(); 182 throw IterableElementError.noElement();
183 let value = this[core.$elementAt](0); 183 let value = this[core.$elementAt](0);
184 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 184 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
185 value = dart.dcall(combine, value, this[core.$elementAt](i)); 185 value = dart.dcall(combine, value, this[core.$elementAt](i));
186 if (length != this[core.$length]) { 186 if (length != this[core.$length]) {
187 throw new core.ConcurrentModificationError(this); 187 throw new core.ConcurrentModificationError(this);
188 } 188 }
189 } 189 }
190 return value; 190 return value;
191 } 191 }
192 [core.$fold](initialValue, combine) { 192 [core.$fold](initialValue, combine) {
193 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); 193 dart.as(combine, dart.functionType(core.Object, [dart.bottom, E]));
194 let value = initialValue; 194 let value = initialValue;
195 let length = this[core.$length]; 195 let length = this[core.$length];
196 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 196 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
197 value = dart.dcall(combine, value, this[core.$elementAt](i)); 197 value = dart.dcall(combine, value, this[core.$elementAt](i));
198 if (length != this[core.$length]) { 198 if (length != this[core.$length]) {
199 throw new core.ConcurrentModificationError(this); 199 throw new core.ConcurrentModificationError(this);
200 } 200 }
201 } 201 }
202 return value; 202 return value;
203 } 203 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 ListIterable[dart.implements] = () => [EfficientLength]; 240 ListIterable[dart.implements] = () => [EfficientLength];
241 dart.setSignature(ListIterable, { 241 dart.setSignature(ListIterable, {
242 methods: () => ({ 242 methods: () => ({
243 [core.$forEach]: [dart.void, [dart.functionType(dart.void, [E])]], 243 [core.$forEach]: [dart.void, [dart.functionType(dart.void, [E])]],
244 [core.$every]: [core.bool, [dart.functionType(core.bool, [E])]], 244 [core.$every]: [core.bool, [dart.functionType(core.bool, [E])]],
245 [core.$any]: [core.bool, [dart.functionType(core.bool, [E])]], 245 [core.$any]: [core.bool, [dart.functionType(core.bool, [E])]],
246 [core.$firstWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart .functionType(E, [])}], 246 [core.$firstWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart .functionType(E, [])}],
247 [core.$lastWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart. functionType(E, [])}], 247 [core.$lastWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart. functionType(E, [])}],
248 [core.$singleWhere]: [E, [dart.functionType(core.bool, [E])]], 248 [core.$singleWhere]: [E, [dart.functionType(core.bool, [E])]],
249 [core.$where]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]], 249 [core.$where]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
250 [core.$map]: [core.Iterable, [dart.functionType(dart.dynamic, [E])]], 250 [core.$map]: [core.Iterable, [dart.functionType(core.Object, [E])]],
251 [core.$reduce]: [E, [dart.functionType(E, [dart.dynamic, E])]], 251 [core.$reduce]: [E, [dart.functionType(E, [dart.bottom, E])]],
252 [core.$fold]: [dart.dynamic, [dart.dynamic, dart.functionType(dart.dynam ic, [dart.dynamic, E])]], 252 [core.$fold]: [core.Object, [core.Object, dart.functionType(core.Object, [dart.bottom, E])]],
253 [core.$skip]: [core.Iterable$(E), [core.int]], 253 [core.$skip]: [core.Iterable$(E), [core.int]],
254 [core.$skipWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]], 254 [core.$skipWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]],
255 [core.$take]: [core.Iterable$(E), [core.int]], 255 [core.$take]: [core.Iterable$(E), [core.int]],
256 [core.$takeWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]], 256 [core.$takeWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]],
257 [core.$toList]: [core.List$(E), [], {rowabl: core.bool}], 257 [core.$toList]: [core.List$(E), [], {rowabl: core.bool}],
258 [core.$toSet]: [core.Set$(E), []] 258 [core.$toSet]: [core.Set$(E), []]
259 }) 259 })
260 }); 260 });
261 return ListIterable; 261 return ListIterable;
262 }); 262 });
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 [core.$join](separator) { 900 [core.$join](separator) {
901 if (separator === void 0) 901 if (separator === void 0)
902 separator = ""; 902 separator = "";
903 return ""; 903 return "";
904 } 904 }
905 [core.$where](test) { 905 [core.$where](test) {
906 dart.as(test, dart.functionType(core.bool, [E])); 906 dart.as(test, dart.functionType(core.bool, [E]));
907 return this; 907 return this;
908 } 908 }
909 [core.$map](f) { 909 [core.$map](f) {
910 dart.as(f, dart.functionType(dart.dynamic, [E])); 910 dart.as(f, dart.functionType(core.Object, [E]));
911 return dart.const(new (EmptyIterable$())()); 911 return dart.const(new (EmptyIterable$())());
912 } 912 }
913 [core.$reduce](combine) { 913 [core.$reduce](combine) {
914 dart.as(combine, dart.functionType(E, [E, E])); 914 dart.as(combine, dart.functionType(E, [E, E]));
915 throw IterableElementError.noElement(); 915 throw IterableElementError.noElement();
916 } 916 }
917 [core.$fold](initialValue, combine) { 917 [core.$fold](initialValue, combine) {
918 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); 918 dart.as(combine, dart.functionType(core.Object, [dart.bottom, E]));
919 return initialValue; 919 return initialValue;
920 } 920 }
921 [core.$skip](count) { 921 [core.$skip](count) {
922 core.RangeError.checkNotNegative(count, "count"); 922 core.RangeError.checkNotNegative(count, "count");
923 return this; 923 return this;
924 } 924 }
925 [core.$skipWhile](test) { 925 [core.$skipWhile](test) {
926 dart.as(test, dart.functionType(core.bool, [E])); 926 dart.as(test, dart.functionType(core.bool, [E]));
927 return this; 927 return this;
928 } 928 }
(...skipping 17 matching lines...) Expand all
946 dart.setSignature(EmptyIterable, { 946 dart.setSignature(EmptyIterable, {
947 methods: () => ({ 947 methods: () => ({
948 [core.$forEach]: [dart.void, [dart.functionType(dart.void, [E])]], 948 [core.$forEach]: [dart.void, [dart.functionType(dart.void, [E])]],
949 [core.$elementAt]: [E, [core.int]], 949 [core.$elementAt]: [E, [core.int]],
950 [core.$every]: [core.bool, [dart.functionType(core.bool, [E])]], 950 [core.$every]: [core.bool, [dart.functionType(core.bool, [E])]],
951 [core.$any]: [core.bool, [dart.functionType(core.bool, [E])]], 951 [core.$any]: [core.bool, [dart.functionType(core.bool, [E])]],
952 [core.$firstWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart .functionType(E, [])}], 952 [core.$firstWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart .functionType(E, [])}],
953 [core.$lastWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart. functionType(E, [])}], 953 [core.$lastWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dart. functionType(E, [])}],
954 [core.$singleWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dar t.functionType(E, [])}], 954 [core.$singleWhere]: [E, [dart.functionType(core.bool, [E])], {rEls: dar t.functionType(E, [])}],
955 [core.$where]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]], 955 [core.$where]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
956 [core.$map]: [core.Iterable, [dart.functionType(dart.dynamic, [E])]], 956 [core.$map]: [core.Iterable, [dart.functionType(core.Object, [E])]],
957 [core.$reduce]: [E, [dart.functionType(E, [E, E])]], 957 [core.$reduce]: [E, [dart.functionType(E, [E, E])]],
958 [core.$fold]: [dart.dynamic, [dart.dynamic, dart.functionType(dart.dynam ic, [dart.dynamic, E])]], 958 [core.$fold]: [core.Object, [core.Object, dart.functionType(core.Object, [dart.bottom, E])]],
959 [core.$skip]: [core.Iterable$(E), [core.int]], 959 [core.$skip]: [core.Iterable$(E), [core.int]],
960 [core.$skipWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]], 960 [core.$skipWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]],
961 [core.$take]: [core.Iterable$(E), [core.int]], 961 [core.$take]: [core.Iterable$(E), [core.int]],
962 [core.$takeWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]], 962 [core.$takeWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]],
963 [core.$toList]: [core.List$(E), [], {rowabl: core.bool}], 963 [core.$toList]: [core.List$(E), [], {rowabl: core.bool}],
964 [core.$toSet]: [core.Set$(E), []] 964 [core.$toSet]: [core.Set$(E), []]
965 }) 965 })
966 }); 966 });
967 return EmptyIterable; 967 return EmptyIterable;
968 }); 968 });
(...skipping 25 matching lines...) Expand all
994 let IterableMixinWorkaround$ = dart.generic(function(T) { 994 let IterableMixinWorkaround$ = dart.generic(function(T) {
995 class IterableMixinWorkaround extends core.Object { 995 class IterableMixinWorkaround extends core.Object {
996 static contains(iterable, element) { 996 static contains(iterable, element) {
997 for (let e of iterable) { 997 for (let e of iterable) {
998 if (dart.equals(e, element)) 998 if (dart.equals(e, element))
999 return true; 999 return true;
1000 } 1000 }
1001 return false; 1001 return false;
1002 } 1002 }
1003 static forEach(iterable, f) { 1003 static forEach(iterable, f) {
1004 dart.as(f, dart.functionType(dart.void, [dart.dynamic])); 1004 dart.as(f, dart.functionType(dart.void, [dart.bottom]));
1005 for (let e of iterable) { 1005 for (let e of iterable) {
1006 dart.dcall(f, e); 1006 dart.dcall(f, e);
1007 } 1007 }
1008 } 1008 }
1009 static any(iterable, f) { 1009 static any(iterable, f) {
1010 dart.as(f, dart.functionType(core.bool, [dart.dynamic])); 1010 dart.as(f, dart.functionType(core.bool, [dart.bottom]));
1011 for (let e of iterable) { 1011 for (let e of iterable) {
1012 if (dart.dcall(f, e)) 1012 if (dart.dcall(f, e))
1013 return true; 1013 return true;
1014 } 1014 }
1015 return false; 1015 return false;
1016 } 1016 }
1017 static every(iterable, f) { 1017 static every(iterable, f) {
1018 dart.as(f, dart.functionType(core.bool, [dart.dynamic])); 1018 dart.as(f, dart.functionType(core.bool, [dart.bottom]));
1019 for (let e of iterable) { 1019 for (let e of iterable) {
1020 if (!dart.notNull(dart.dcall(f, e))) 1020 if (!dart.notNull(dart.dcall(f, e)))
1021 return false; 1021 return false;
1022 } 1022 }
1023 return true; 1023 return true;
1024 } 1024 }
1025 static reduce(iterable, combine) { 1025 static reduce(iterable, combine) {
1026 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, dart.dyn amic])); 1026 dart.as(combine, dart.functionType(core.Object, [dart.bottom, dart.botto m]));
1027 let iterator = iterable[core.$iterator]; 1027 let iterator = iterable[core.$iterator];
1028 if (!dart.notNull(iterator.moveNext())) 1028 if (!dart.notNull(iterator.moveNext()))
1029 throw IterableElementError.noElement(); 1029 throw IterableElementError.noElement();
1030 let value = iterator.current; 1030 let value = iterator.current;
1031 while (iterator.moveNext()) { 1031 while (iterator.moveNext()) {
1032 value = dart.dcall(combine, value, iterator.current); 1032 value = dart.dcall(combine, value, iterator.current);
1033 } 1033 }
1034 return value; 1034 return value;
1035 } 1035 }
1036 static fold(iterable, initialValue, combine) { 1036 static fold(iterable, initialValue, combine) {
1037 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, dart.dyn amic])); 1037 dart.as(combine, dart.functionType(core.Object, [dart.bottom, dart.botto m]));
1038 for (let element of iterable) { 1038 for (let element of iterable) {
1039 initialValue = dart.dcall(combine, initialValue, element); 1039 initialValue = dart.dcall(combine, initialValue, element);
1040 } 1040 }
1041 return initialValue; 1041 return initialValue;
1042 } 1042 }
1043 static removeWhereList(list, test) { 1043 static removeWhereList(list, test) {
1044 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1044 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1045 let retained = []; 1045 let retained = [];
1046 let length = list[core.$length]; 1046 let length = list[core.$length];
1047 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1047 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1048 let element = list[core.$get](i); 1048 let element = list[core.$get](i);
1049 if (!dart.notNull(dart.dcall(test, element))) { 1049 if (!dart.notNull(dart.dcall(test, element))) {
1050 retained[core.$add](element); 1050 retained[core.$add](element);
1051 } 1051 }
1052 if (length != list[core.$length]) { 1052 if (length != list[core.$length]) {
1053 throw new core.ConcurrentModificationError(list); 1053 throw new core.ConcurrentModificationError(list);
1054 } 1054 }
(...skipping 29 matching lines...) Expand all
1084 static single(iterable) { 1084 static single(iterable) {
1085 let it = iterable[core.$iterator]; 1085 let it = iterable[core.$iterator];
1086 if (!dart.notNull(it.moveNext())) 1086 if (!dart.notNull(it.moveNext()))
1087 throw IterableElementError.noElement(); 1087 throw IterableElementError.noElement();
1088 let result = it.current; 1088 let result = it.current;
1089 if (it.moveNext()) 1089 if (it.moveNext())
1090 throw IterableElementError.tooMany(); 1090 throw IterableElementError.tooMany();
1091 return result; 1091 return result;
1092 } 1092 }
1093 static firstWhere(iterable, test, orElse) { 1093 static firstWhere(iterable, test, orElse) {
1094 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1094 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1095 dart.as(orElse, dart.functionType(dart.dynamic, [])); 1095 dart.as(orElse, dart.functionType(core.Object, []));
1096 for (let element of iterable) { 1096 for (let element of iterable) {
1097 if (dart.dcall(test, element)) 1097 if (dart.dcall(test, element))
1098 return element; 1098 return element;
1099 } 1099 }
1100 if (orElse != null) 1100 if (orElse != null)
1101 return orElse(); 1101 return orElse();
1102 throw IterableElementError.noElement(); 1102 throw IterableElementError.noElement();
1103 } 1103 }
1104 static lastWhere(iterable, test, orElse) { 1104 static lastWhere(iterable, test, orElse) {
1105 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1105 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1106 dart.as(orElse, dart.functionType(dart.dynamic, [])); 1106 dart.as(orElse, dart.functionType(core.Object, []));
1107 let result = null; 1107 let result = null;
1108 let foundMatching = false; 1108 let foundMatching = false;
1109 for (let element of iterable) { 1109 for (let element of iterable) {
1110 if (dart.dcall(test, element)) { 1110 if (dart.dcall(test, element)) {
1111 result = element; 1111 result = element;
1112 foundMatching = true; 1112 foundMatching = true;
1113 } 1113 }
1114 } 1114 }
1115 if (foundMatching) 1115 if (foundMatching)
1116 return result; 1116 return result;
1117 if (orElse != null) 1117 if (orElse != null)
1118 return orElse(); 1118 return orElse();
1119 throw IterableElementError.noElement(); 1119 throw IterableElementError.noElement();
1120 } 1120 }
1121 static lastWhereList(list, test, orElse) { 1121 static lastWhereList(list, test, orElse) {
1122 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1122 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1123 dart.as(orElse, dart.functionType(dart.dynamic, [])); 1123 dart.as(orElse, dart.functionType(core.Object, []));
1124 for (let i = dart.notNull(list[core.$length]) - 1; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { 1124 for (let i = dart.notNull(list[core.$length]) - 1; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
1125 let element = list[core.$get](i); 1125 let element = list[core.$get](i);
1126 if (dart.dcall(test, element)) 1126 if (dart.dcall(test, element))
1127 return element; 1127 return element;
1128 } 1128 }
1129 if (orElse != null) 1129 if (orElse != null)
1130 return orElse(); 1130 return orElse();
1131 throw IterableElementError.noElement(); 1131 throw IterableElementError.noElement();
1132 } 1132 }
1133 static singleWhere(iterable, test) { 1133 static singleWhere(iterable, test) {
1134 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1134 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1135 let result = null; 1135 let result = null;
1136 let foundMatching = false; 1136 let foundMatching = false;
1137 for (let element of iterable) { 1137 for (let element of iterable) {
1138 if (dart.dcall(test, element)) { 1138 if (dart.dcall(test, element)) {
1139 if (foundMatching) { 1139 if (foundMatching) {
1140 throw IterableElementError.tooMany(); 1140 throw IterableElementError.tooMany();
1141 } 1141 }
1142 result = element; 1142 result = element;
1143 foundMatching = true; 1143 foundMatching = true;
1144 } 1144 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 } else { 1181 } else {
1182 buffer.write(list[core.$get](0)); 1182 buffer.write(list[core.$get](0));
1183 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = dart.notNull(i) + 1) { 1183 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = dart.notNull(i) + 1) {
1184 buffer.write(separator); 1184 buffer.write(separator);
1185 buffer.write(list[core.$get](i)); 1185 buffer.write(list[core.$get](i));
1186 } 1186 }
1187 } 1187 }
1188 return dart.toString(buffer); 1188 return dart.toString(buffer);
1189 } 1189 }
1190 where(iterable, f) { 1190 where(iterable, f) {
1191 dart.as(f, dart.functionType(core.bool, [dart.dynamic])); 1191 dart.as(f, dart.functionType(core.bool, [dart.bottom]));
1192 return new (WhereIterable$(T))(dart.as(iterable, core.Iterable$(T)), dar t.as(f, __CastType6)); 1192 return new (WhereIterable$(T))(dart.as(iterable, core.Iterable$(T)), dar t.as(f, __CastType6));
1193 } 1193 }
1194 static map(iterable, f) { 1194 static map(iterable, f) {
1195 dart.as(f, dart.functionType(dart.dynamic, [dart.dynamic])); 1195 dart.as(f, dart.functionType(core.Object, [dart.bottom]));
1196 return new MappedIterable(iterable, f); 1196 return new MappedIterable(iterable, f);
1197 } 1197 }
1198 static mapList(list, f) { 1198 static mapList(list, f) {
1199 dart.as(f, dart.functionType(dart.dynamic, [dart.dynamic])); 1199 dart.as(f, dart.functionType(core.Object, [dart.bottom]));
1200 return new MappedListIterable(list, f); 1200 return new MappedListIterable(list, f);
1201 } 1201 }
1202 static expand(iterable, f) { 1202 static expand(iterable, f) {
1203 dart.as(f, dart.functionType(core.Iterable, [dart.dynamic])); 1203 dart.as(f, dart.functionType(core.Iterable, [dart.bottom]));
1204 return new ExpandIterable(iterable, f); 1204 return new ExpandIterable(iterable, f);
1205 } 1205 }
1206 takeList(list, n) { 1206 takeList(list, n) {
1207 return new (SubListIterable$(T))(dart.as(list, core.Iterable$(T)), 0, n) ; 1207 return new (SubListIterable$(T))(dart.as(list, core.Iterable$(T)), 0, n) ;
1208 } 1208 }
1209 takeWhile(iterable, test) { 1209 takeWhile(iterable, test) {
1210 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1210 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1211 return new (TakeWhileIterable$(T))(dart.as(iterable, core.Iterable$(T)), dart.as(test, dart.functionType(core.bool, [T]))); 1211 return new (TakeWhileIterable$(T))(dart.as(iterable, core.Iterable$(T)), dart.as(test, dart.functionType(core.bool, [T])));
1212 } 1212 }
1213 skipList(list, n) { 1213 skipList(list, n) {
1214 return new (SubListIterable$(T))(dart.as(list, core.Iterable$(T)), n, nu ll); 1214 return new (SubListIterable$(T))(dart.as(list, core.Iterable$(T)), n, nu ll);
1215 } 1215 }
1216 skipWhile(iterable, test) { 1216 skipWhile(iterable, test) {
1217 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); 1217 dart.as(test, dart.functionType(core.bool, [dart.bottom]));
1218 return new (SkipWhileIterable$(T))(dart.as(iterable, core.Iterable$(T)), dart.as(test, dart.functionType(core.bool, [T]))); 1218 return new (SkipWhileIterable$(T))(dart.as(iterable, core.Iterable$(T)), dart.as(test, dart.functionType(core.bool, [T])));
1219 } 1219 }
1220 reversedList(list) { 1220 reversedList(list) {
1221 return new (ReversedListIterable$(T))(dart.as(list, core.Iterable$(T))); 1221 return new (ReversedListIterable$(T))(dart.as(list, core.Iterable$(T)));
1222 } 1222 }
1223 static sortList(list, compare) { 1223 static sortList(list, compare) {
1224 dart.as(compare, dart.functionType(core.int, [dart.dynamic, dart.dynamic ])); 1224 dart.as(compare, dart.functionType(core.int, [dart.bottom, dart.bottom]) );
1225 if (compare == null) 1225 if (compare == null)
1226 compare = core.Comparable.compare; 1226 compare = core.Comparable.compare;
1227 Sort.sort(list, compare); 1227 Sort.sort(list, compare);
1228 } 1228 }
1229 static shuffleList(list, random) { 1229 static shuffleList(list, random) {
1230 if (random == null) 1230 if (random == null)
1231 random = new math.Random(); 1231 random = new math.Random();
1232 let length = list[core.$length]; 1232 let length = list[core.$length];
1233 while (dart.notNull(length) > 1) { 1233 while (dart.notNull(length) > 1) {
1234 let pos = random.nextInt(length); 1234 let pos = random.nextInt(length);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 for (let element of set) { 1367 for (let element of set) {
1368 if (!dart.notNull(other[core.$contains](element))) { 1368 if (!dart.notNull(other[core.$contains](element))) {
1369 result.add(element); 1369 result.add(element);
1370 } 1370 }
1371 } 1371 }
1372 return result; 1372 return result;
1373 } 1373 }
1374 } 1374 }
1375 dart.setSignature(IterableMixinWorkaround, { 1375 dart.setSignature(IterableMixinWorkaround, {
1376 methods: () => ({ 1376 methods: () => ({
1377 where: [core.Iterable$(T), [core.Iterable, dart.functionType(core.bool, [dart.dynamic])]], 1377 where: [core.Iterable$(T), [core.Iterable, dart.functionType(core.bool, [dart.bottom])]],
1378 takeList: [core.Iterable$(T), [core.List, core.int]], 1378 takeList: [core.Iterable$(T), [core.List, core.int]],
1379 takeWhile: [core.Iterable$(T), [core.Iterable, dart.functionType(core.bo ol, [dart.dynamic])]], 1379 takeWhile: [core.Iterable$(T), [core.Iterable, dart.functionType(core.bo ol, [dart.bottom])]],
1380 skipList: [core.Iterable$(T), [core.List, core.int]], 1380 skipList: [core.Iterable$(T), [core.List, core.int]],
1381 skipWhile: [core.Iterable$(T), [core.Iterable, dart.functionType(core.bo ol, [dart.dynamic])]], 1381 skipWhile: [core.Iterable$(T), [core.Iterable, dart.functionType(core.bo ol, [dart.bottom])]],
1382 reversedList: [core.Iterable$(T), [core.List]], 1382 reversedList: [core.Iterable$(T), [core.List]],
1383 getRangeList: [core.Iterable$(T), [core.List, core.int, core.int]], 1383 getRangeList: [core.Iterable$(T), [core.List, core.int, core.int]],
1384 asMapList: [core.Map$(core.int, T), [core.List]] 1384 asMapList: [core.Map$(core.int, T), [core.List]]
1385 }), 1385 }),
1386 statics: () => ({ 1386 statics: () => ({
1387 contains: [core.bool, [core.Iterable, dart.dynamic]], 1387 contains: [core.bool, [core.Iterable, core.Object]],
1388 forEach: [dart.void, [core.Iterable, dart.functionType(dart.void, [dart. dynamic])]], 1388 forEach: [dart.void, [core.Iterable, dart.functionType(dart.void, [dart. bottom])]],
1389 any: [core.bool, [core.Iterable, dart.functionType(core.bool, [dart.dyna mic])]], 1389 any: [core.bool, [core.Iterable, dart.functionType(core.bool, [dart.bott om])]],
1390 every: [core.bool, [core.Iterable, dart.functionType(core.bool, [dart.dy namic])]], 1390 every: [core.bool, [core.Iterable, dart.functionType(core.bool, [dart.bo ttom])]],
1391 reduce: [dart.dynamic, [core.Iterable, dart.functionType(dart.dynamic, [ dart.dynamic, dart.dynamic])]], 1391 reduce: [core.Object, [core.Iterable, dart.functionType(core.Object, [da rt.bottom, dart.bottom])]],
1392 fold: [dart.dynamic, [core.Iterable, dart.dynamic, dart.functionType(dar t.dynamic, [dart.dynamic, dart.dynamic])]], 1392 fold: [core.Object, [core.Iterable, core.Object, dart.functionType(core. Object, [dart.bottom, dart.bottom])]],
1393 removeWhereList: [dart.void, [core.List, dart.functionType(core.bool, [d art.dynamic])]], 1393 removeWhereList: [dart.void, [core.List, dart.functionType(core.bool, [d art.bottom])]],
1394 isEmpty: [core.bool, [core.Iterable]], 1394 isEmpty: [core.bool, [core.Iterable]],
1395 first: [dart.dynamic, [core.Iterable]], 1395 first: [core.Object, [core.Iterable]],
1396 last: [dart.dynamic, [core.Iterable]], 1396 last: [core.Object, [core.Iterable]],
1397 single: [dart.dynamic, [core.Iterable]], 1397 single: [core.Object, [core.Iterable]],
1398 firstWhere: [dart.dynamic, [core.Iterable, dart.functionType(core.bool, [dart.dynamic]), dart.functionType(dart.dynamic, [])]], 1398 firstWhere: [core.Object, [core.Iterable, dart.functionType(core.bool, [ dart.bottom]), dart.functionType(core.Object, [])]],
1399 lastWhere: [dart.dynamic, [core.Iterable, dart.functionType(core.bool, [ dart.dynamic]), dart.functionType(dart.dynamic, [])]], 1399 lastWhere: [core.Object, [core.Iterable, dart.functionType(core.bool, [d art.bottom]), dart.functionType(core.Object, [])]],
1400 lastWhereList: [dart.dynamic, [core.List, dart.functionType(core.bool, [ dart.dynamic]), dart.functionType(dart.dynamic, [])]], 1400 lastWhereList: [core.Object, [core.List, dart.functionType(core.bool, [d art.bottom]), dart.functionType(core.Object, [])]],
1401 singleWhere: [dart.dynamic, [core.Iterable, dart.functionType(core.bool, [dart.dynamic])]], 1401 singleWhere: [core.Object, [core.Iterable, dart.functionType(core.bool, [dart.bottom])]],
1402 elementAt: [dart.dynamic, [core.Iterable, core.int]], 1402 elementAt: [core.Object, [core.Iterable, core.int]],
1403 join: [core.String, [core.Iterable], [core.String]], 1403 join: [core.String, [core.Iterable], [core.String]],
1404 joinList: [core.String, [core.List], [core.String]], 1404 joinList: [core.String, [core.List], [core.String]],
1405 map: [core.Iterable, [core.Iterable, dart.functionType(dart.dynamic, [da rt.dynamic])]], 1405 map: [core.Iterable, [core.Iterable, dart.functionType(core.Object, [dar t.bottom])]],
1406 mapList: [core.Iterable, [core.List, dart.functionType(dart.dynamic, [da rt.dynamic])]], 1406 mapList: [core.Iterable, [core.List, dart.functionType(core.Object, [dar t.bottom])]],
1407 expand: [core.Iterable, [core.Iterable, dart.functionType(core.Iterable, [dart.dynamic])]], 1407 expand: [core.Iterable, [core.Iterable, dart.functionType(core.Iterable, [dart.bottom])]],
1408 sortList: [dart.void, [core.List, dart.functionType(core.int, [dart.dyna mic, dart.dynamic])]], 1408 sortList: [dart.void, [core.List, dart.functionType(core.int, [dart.bott om, dart.bottom])]],
1409 shuffleList: [dart.void, [core.List, math.Random]], 1409 shuffleList: [dart.void, [core.List, math.Random]],
1410 indexOfList: [core.int, [core.List, dart.dynamic, core.int]], 1410 indexOfList: [core.int, [core.List, core.Object, core.int]],
1411 lastIndexOfList: [core.int, [core.List, dart.dynamic, core.int]], 1411 lastIndexOfList: [core.int, [core.List, core.Object, core.int]],
1412 _rangeCheck: [dart.void, [core.List, core.int, core.int]], 1412 _rangeCheck: [dart.void, [core.List, core.int, core.int]],
1413 setRangeList: [dart.void, [core.List, core.int, core.int, core.Iterable, core.int]], 1413 setRangeList: [dart.void, [core.List, core.int, core.int, core.Iterable, core.int]],
1414 replaceRangeList: [dart.void, [core.List, core.int, core.int, core.Itera ble]], 1414 replaceRangeList: [dart.void, [core.List, core.int, core.int, core.Itera ble]],
1415 fillRangeList: [dart.void, [core.List, core.int, core.int, dart.dynamic] ], 1415 fillRangeList: [dart.void, [core.List, core.int, core.int, core.Object]] ,
1416 insertAllList: [dart.void, [core.List, core.int, core.Iterable]], 1416 insertAllList: [dart.void, [core.List, core.int, core.Iterable]],
1417 setAllList: [dart.void, [core.List, core.int, core.Iterable]], 1417 setAllList: [dart.void, [core.List, core.int, core.Iterable]],
1418 setContainsAll: [core.bool, [core.Set, core.Iterable]], 1418 setContainsAll: [core.bool, [core.Set, core.Iterable]],
1419 setIntersection: [core.Set, [core.Set, core.Set, core.Set]], 1419 setIntersection: [core.Set, [core.Set, core.Set, core.Set]],
1420 setUnion: [core.Set, [core.Set, core.Set, core.Set]], 1420 setUnion: [core.Set, [core.Set, core.Set, core.Set]],
1421 setDifference: [core.Set, [core.Set, core.Set, core.Set]] 1421 setDifference: [core.Set, [core.Set, core.Set, core.Set]]
1422 }), 1422 }),
1423 names: ['contains', 'forEach', 'any', 'every', 'reduce', 'fold', 'removeWh ereList', 'isEmpty', 'first', 'last', 'single', 'firstWhere', 'lastWhere', 'last WhereList', 'singleWhere', 'elementAt', 'join', 'joinList', 'map', 'mapList', 'e xpand', 'sortList', 'shuffleList', 'indexOfList', 'lastIndexOfList', '_rangeChec k', 'setRangeList', 'replaceRangeList', 'fillRangeList', 'insertAllList', 'setAl lList', 'setContainsAll', 'setIntersection', 'setUnion', 'setDifference'] 1423 names: ['contains', 'forEach', 'any', 'every', 'reduce', 'fold', 'removeWh ereList', 'isEmpty', 'first', 'last', 'single', 'firstWhere', 'lastWhere', 'last WhereList', 'singleWhere', 'elementAt', 'join', 'joinList', 'map', 'mapList', 'e xpand', 'sortList', 'shuffleList', 'indexOfList', 'lastIndexOfList', '_rangeChec k', 'setRangeList', 'replaceRangeList', 'fillRangeList', 'insertAllList', 'setAl lList', 'setContainsAll', 'setIntersection', 'setUnion', 'setDifference']
1424 }); 1424 });
1425 return IterableMixinWorkaround; 1425 return IterableMixinWorkaround;
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 core.RangeError.checkNotNegative(start); 1872 core.RangeError.checkNotNegative(start);
1873 if (dart.notNull(start) + dart.notNull(length) > dart.notNull(a[core.$leng th])) { 1873 if (dart.notNull(start) + dart.notNull(length) > dart.notNull(a[core.$leng th])) {
1874 let message = `${start} + ${length} must be in the range [0..${a[core.$l ength]}]`; 1874 let message = `${start} + ${length} must be in the range [0..${a[core.$l ength]}]`;
1875 throw new core.RangeError.range(length, 0, dart.notNull(a[core.$length]) - dart.notNull(start), "length", message); 1875 throw new core.RangeError.range(length, 0, dart.notNull(a[core.$length]) - dart.notNull(start), "length", message);
1876 } 1876 }
1877 } 1877 }
1878 } 1878 }
1879 dart.setSignature(Lists, { 1879 dart.setSignature(Lists, {
1880 statics: () => ({ 1880 statics: () => ({
1881 copy: [dart.void, [core.List, core.int, core.List, core.int, core.int]], 1881 copy: [dart.void, [core.List, core.int, core.List, core.int, core.int]],
1882 areEqual: [core.bool, [core.List, dart.dynamic]], 1882 areEqual: [core.bool, [core.List, core.Object]],
1883 indexOf: [core.int, [core.List, core.Object, core.int, core.int]], 1883 indexOf: [core.int, [core.List, core.Object, core.int, core.int]],
1884 lastIndexOf: [core.int, [core.List, core.Object, core.int]], 1884 lastIndexOf: [core.int, [core.List, core.Object, core.int]],
1885 indicesCheck: [dart.void, [core.List, core.int, core.int]], 1885 indicesCheck: [dart.void, [core.List, core.int, core.int]],
1886 rangeCheck: [dart.void, [core.List, core.int, core.int]] 1886 rangeCheck: [dart.void, [core.List, core.int, core.int]]
1887 }), 1887 }),
1888 names: ['copy', 'areEqual', 'indexOf', 'lastIndexOf', 'indicesCheck', 'range Check'] 1888 names: ['copy', 'areEqual', 'indexOf', 'lastIndexOf', 'indicesCheck', 'range Check']
1889 }); 1889 });
1890 exports.printToZone = null; 1890 exports.printToZone = null;
1891 function printToConsole(line) { 1891 function printToConsole(line) {
1892 _js_primitives.printString(`${line}`); 1892 _js_primitives.printString(`${line}`);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2145 } 2145 }
2146 } 2146 }
2147 Sort._doSort(a, less, great, compare); 2147 Sort._doSort(a, less, great, compare);
2148 } else { 2148 } else {
2149 Sort._doSort(a, less, great, compare); 2149 Sort._doSort(a, less, great, compare);
2150 } 2150 }
2151 } 2151 }
2152 } 2152 }
2153 dart.setSignature(Sort, { 2153 dart.setSignature(Sort, {
2154 statics: () => ({ 2154 statics: () => ({
2155 sort: [dart.void, [core.List, dart.functionType(core.int, [dart.dynamic, d art.dynamic])]], 2155 sort: [dart.void, [core.List, dart.functionType(core.int, [dart.bottom, da rt.bottom])]],
2156 sortRange: [dart.void, [core.List, core.int, core.int, dart.functionType(c ore.int, [dart.dynamic, dart.dynamic])]], 2156 sortRange: [dart.void, [core.List, core.int, core.int, dart.functionType(c ore.int, [dart.bottom, dart.bottom])]],
2157 _doSort: [dart.void, [core.List, core.int, core.int, dart.functionType(cor e.int, [dart.dynamic, dart.dynamic])]], 2157 _doSort: [dart.void, [core.List, core.int, core.int, dart.functionType(cor e.int, [dart.bottom, dart.bottom])]],
2158 _insertionSort: [dart.void, [core.List, core.int, core.int, dart.functionT ype(core.int, [dart.dynamic, dart.dynamic])]], 2158 _insertionSort: [dart.void, [core.List, core.int, core.int, dart.functionT ype(core.int, [dart.bottom, dart.bottom])]],
2159 _dualPivotQuicksort: [dart.void, [core.List, core.int, core.int, dart.func tionType(core.int, [dart.dynamic, dart.dynamic])]] 2159 _dualPivotQuicksort: [dart.void, [core.List, core.int, core.int, dart.func tionType(core.int, [dart.bottom, dart.bottom])]]
2160 }), 2160 }),
2161 names: ['sort', 'sortRange', '_doSort', '_insertionSort', '_dualPivotQuickso rt'] 2161 names: ['sort', 'sortRange', '_doSort', '_insertionSort', '_dualPivotQuickso rt']
2162 }); 2162 });
2163 Sort._INSERTION_SORT_THRESHOLD = 32; 2163 Sort._INSERTION_SORT_THRESHOLD = 32;
2164 let _name = dart.JsSymbol('_name'); 2164 let _name = dart.JsSymbol('_name');
2165 class Symbol extends core.Object { 2165 class Symbol extends core.Object {
2166 Symbol(name) { 2166 Symbol(name) {
2167 this[_name] = name; 2167 this[_name] = name;
2168 } 2168 }
2169 unvalidated(name) { 2169 unvalidated(name) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 exports.ReversedListIterable = ReversedListIterable; 2289 exports.ReversedListIterable = ReversedListIterable;
2290 exports.UnmodifiableListError = UnmodifiableListError; 2290 exports.UnmodifiableListError = UnmodifiableListError;
2291 exports.NonGrowableListError = NonGrowableListError; 2291 exports.NonGrowableListError = NonGrowableListError;
2292 exports.makeListFixedLength = makeListFixedLength; 2292 exports.makeListFixedLength = makeListFixedLength;
2293 exports.Lists = Lists; 2293 exports.Lists = Lists;
2294 exports.printToConsole = printToConsole; 2294 exports.printToConsole = printToConsole;
2295 exports.Sort = Sort; 2295 exports.Sort = Sort;
2296 exports.Symbol = Symbol; 2296 exports.Symbol = Symbol;
2297 exports.POWERS_OF_TEN = POWERS_OF_TEN; 2297 exports.POWERS_OF_TEN = POWERS_OF_TEN;
2298 })(_internal, core, collection, math, _interceptors, _js_primitives); 2298 })(_internal, core, collection, math, _interceptors, _js_primitives);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698