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

Side by Side Diff: test/codegen/expect/dart/collection.js

Issue 977613002: Make int and double nullable by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: actually upload changes Created 5 years, 9 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 collection; 1 var collection;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 let _length = Symbol('_length'); 4 let _length = Symbol('_length');
5 let _strings = Symbol('_strings'); 5 let _strings = Symbol('_strings');
6 let _nums = Symbol('_nums'); 6 let _nums = Symbol('_nums');
7 let _rest = Symbol('_rest'); 7 let _rest = Symbol('_rest');
8 let _keys = Symbol('_keys'); 8 let _keys = Symbol('_keys');
9 let _containsKey = Symbol('_containsKey'); 9 let _containsKey = Symbol('_containsKey');
10 let _getBucket = Symbol('_getBucket'); 10 let _getBucket = Symbol('_getBucket');
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return nums === null ? false : _hasTableEntry(nums, key); 56 return nums === null ? false : _hasTableEntry(nums, key);
57 } else { 57 } else {
58 return this[_containsKey](key); 58 return this[_containsKey](key);
59 } 59 }
60 } 60 }
61 [_containsKey](key) { 61 [_containsKey](key) {
62 let rest = this[_rest]; 62 let rest = this[_rest];
63 if (rest === null) 63 if (rest === null)
64 return false; 64 return false;
65 let bucket = this[_getBucket](rest, key); 65 let bucket = this[_getBucket](rest, key);
66 return this[_findBucketIndex](bucket, key) >= 0; 66 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
67 } 67 }
68 containsValue(value) { 68 containsValue(value) {
69 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v alue)).bind(this)); 69 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v alue)).bind(this));
70 } 70 }
71 addAll(other) { 71 addAll(other) {
72 other.forEach(((key, value) => { 72 other.forEach(((key, value) => {
73 this.set(key, value); 73 this.set(key, value);
74 }).bind(this)); 74 }).bind(this));
75 } 75 }
76 get(key) { 76 get(key) {
77 if (_isStringKey(key)) { 77 if (_isStringKey(key)) {
78 let strings = this[_strings]; 78 let strings = this[_strings];
79 return dart.as(strings === null ? null : _getTableEntry(strings, key), V); 79 return dart.as(strings === null ? null : _getTableEntry(strings, key), V);
80 } else if (_isNumericKey(key)) { 80 } else if (_isNumericKey(key)) {
81 let nums = this[_nums]; 81 let nums = this[_nums];
82 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); 82 return dart.as(nums === null ? null : _getTableEntry(nums, key), V);
83 } else { 83 } else {
84 return this[_get](key); 84 return this[_get](key);
85 } 85 }
86 } 86 }
87 [_get](key) { 87 [_get](key) {
88 let rest = this[_rest]; 88 let rest = this[_rest];
89 if (rest === null) 89 if (rest === null)
90 return dart.as(null, V); 90 return null;
91 let bucket = this[_getBucket](rest, key); 91 let bucket = this[_getBucket](rest, key);
92 let index = this[_findBucketIndex](bucket, key); 92 let index = this[_findBucketIndex](bucket, key);
93 return dart.as(index < 0 ? null : bucket[index + 1], V); 93 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde x) + 1], V);
94 } 94 }
95 set(key, value) { 95 set(key, value) {
96 if (_isStringKey(key)) { 96 if (_isStringKey(key)) {
97 let strings = this[_strings]; 97 let strings = this[_strings];
98 if (strings === null) 98 if (strings === null)
99 this[_strings] = strings = _newHashTable(); 99 this[_strings] = strings = _newHashTable();
100 this[_addHashTableEntry](strings, key, value); 100 this[_addHashTableEntry](strings, key, value);
101 } else if (_isNumericKey(key)) { 101 } else if (_isNumericKey(key)) {
102 let nums = this[_nums]; 102 let nums = this[_nums];
103 if (nums === null) 103 if (nums === null)
104 this[_nums] = nums = _newHashTable(); 104 this[_nums] = nums = _newHashTable();
105 this[_addHashTableEntry](nums, key, value); 105 this[_addHashTableEntry](nums, key, value);
106 } else { 106 } else {
107 this[_set](key, value); 107 this[_set](key, value);
108 } 108 }
109 } 109 }
110 [_set](key, value) { 110 [_set](key, value) {
111 let rest = this[_rest]; 111 let rest = this[_rest];
112 if (rest === null) 112 if (rest === null)
113 this[_rest] = rest = _newHashTable(); 113 this[_rest] = rest = _newHashTable();
114 let hash = this[_computeHashCode](key); 114 let hash = this[_computeHashCode](key);
115 let bucket = rest[hash]; 115 let bucket = rest[hash];
116 if (bucket === null) { 116 if (bucket === null) {
117 _setTableEntry(rest, hash, [key, value]); 117 _setTableEntry(rest, hash, [key, value]);
118 this[_length]++; 118 dart.notNull(this[_length])++;
119 this[_keys] = null; 119 this[_keys] = null;
120 } else { 120 } else {
121 let index = this[_findBucketIndex](bucket, key); 121 let index = this[_findBucketIndex](bucket, key);
122 if (index >= 0) { 122 if (dart.notNull(index) >= 0) {
123 bucket[index + 1] = value; 123 bucket[dart.notNull(index) + 1] = value;
124 } else { 124 } else {
125 bucket.push(key, value); 125 bucket.push(key, value);
126 this[_length]++; 126 dart.notNull(this[_length])++;
127 this[_keys] = null; 127 this[_keys] = null;
128 } 128 }
129 } 129 }
130 } 130 }
131 putIfAbsent(key, ifAbsent) { 131 putIfAbsent(key, ifAbsent) {
132 if (this.containsKey(key)) 132 if (this.containsKey(key))
133 return this.get(key); 133 return this.get(key);
134 let value = ifAbsent(); 134 let value = ifAbsent();
135 this.set(key, value); 135 this.set(key, value);
136 return value; 136 return value;
137 } 137 }
138 remove(key) { 138 remove(key) {
139 if (_isStringKey(key)) { 139 if (_isStringKey(key)) {
140 return this[_removeHashTableEntry](this[_strings], key); 140 return this[_removeHashTableEntry](this[_strings], key);
141 } else if (_isNumericKey(key)) { 141 } else if (_isNumericKey(key)) {
142 return this[_removeHashTableEntry](this[_nums], key); 142 return this[_removeHashTableEntry](this[_nums], key);
143 } else { 143 } else {
144 return this[_remove](key); 144 return this[_remove](key);
145 } 145 }
146 } 146 }
147 [_remove](key) { 147 [_remove](key) {
148 let rest = this[_rest]; 148 let rest = this[_rest];
149 if (rest === null) 149 if (rest === null)
150 return dart.as(null, V); 150 return null;
151 let bucket = this[_getBucket](rest, key); 151 let bucket = this[_getBucket](rest, key);
152 let index = this[_findBucketIndex](bucket, key); 152 let index = this[_findBucketIndex](bucket, key);
153 if (index < 0) 153 if (dart.notNull(index) < 0)
154 return dart.as(null, V); 154 return null;
155 this[_length]--; 155 dart.notNull(this[_length])--;
156 this[_keys] = null; 156 this[_keys] = null;
157 return dart.as(bucket.splice(index, 2)[1], V); 157 return dart.as(bucket.splice(index, 2)[1], V);
158 } 158 }
159 clear() { 159 clear() {
160 if (this[_length] > 0) { 160 if (dart.notNull(this[_length]) > 0) {
161 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; 161 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null;
162 this[_length] = 0; 162 this[_length] = 0;
163 } 163 }
164 } 164 }
165 forEach(action) { 165 forEach(action) {
166 let keys = this[_computeKeys](); 166 let keys = this[_computeKeys]();
167 for (let i = 0, length = keys.length; i < length; i++) { 167 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len gth); dart.notNull(i)++) {
168 let key = keys[i]; 168 let key = keys[i];
169 action(dart.as(key, K), this.get(key)); 169 action(dart.as(key, K), this.get(key));
170 if (keys !== this[_keys]) { 170 if (keys !== this[_keys]) {
171 throw new core.ConcurrentModificationError(this); 171 throw new core.ConcurrentModificationError(this);
172 } 172 }
173 } 173 }
174 } 174 }
175 [_computeKeys]() { 175 [_computeKeys]() {
176 if (this[_keys] !== null) 176 if (this[_keys] !== null)
177 return this[_keys]; 177 return this[_keys];
178 let result = new core.List(this[_length]); 178 let result = new core.List(this[_length]);
179 let index = 0; 179 let index = 0;
180 let strings = this[_strings]; 180 let strings = this[_strings];
181 if (strings !== null) { 181 if (strings !== null) {
182 let names = Object.getOwnPropertyNames(strings); 182 let names = Object.getOwnPropertyNames(strings);
183 let entries = names.length; 183 let entries = names.length;
184 for (let i = 0; i < entries; i++) { 184 for (let i = 0; dart.notNull(i) < dart.notNull(entries); dart.notNull( i)++) {
185 let key = names[i]; 185 let key = names[i];
186 result[index] = key; 186 result[index] = key;
187 index++; 187 dart.notNull(index)++;
188 } 188 }
189 } 189 }
190 let nums = this[_nums]; 190 let nums = this[_nums];
191 if (nums !== null) { 191 if (nums !== null) {
192 let names = Object.getOwnPropertyNames(nums); 192 let names = Object.getOwnPropertyNames(nums);
193 let entries = names.length; 193 let entries = names.length;
194 for (let i = 0; i < entries; i++) { 194 for (let i = 0; dart.notNull(i) < dart.notNull(entries); dart.notNull( i)++) {
195 let key = +names[i]; 195 let key = +names[i];
196 result[index] = key; 196 result[index] = key;
197 index++; 197 dart.notNull(index)++;
198 } 198 }
199 } 199 }
200 let rest = this[_rest]; 200 let rest = this[_rest];
201 if (rest !== null) { 201 if (rest !== null) {
202 let names = Object.getOwnPropertyNames(rest); 202 let names = Object.getOwnPropertyNames(rest);
203 let entries = names.length; 203 let entries = names.length;
204 for (let i = 0; i < entries; i++) { 204 for (let i = 0; dart.notNull(i) < dart.notNull(entries); dart.notNull( i)++) {
205 let key = names[i]; 205 let key = names[i];
206 let bucket = rest[key]; 206 let bucket = rest[key];
207 let length = bucket.length; 207 let length = bucket.length;
208 for (let i = 0; i < length; i = 2) { 208 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
209 let key = bucket[i]; 209 let key = bucket[i];
210 result[index] = key; 210 result[index] = key;
211 index++; 211 dart.notNull(index)++;
212 } 212 }
213 } 213 }
214 } 214 }
215 dart.assert(index === this[_length]); 215 dart.assert(index === this[_length]);
216 return this[_keys] = result; 216 return this[_keys] = result;
217 } 217 }
218 [_addHashTableEntry](table, key, value) { 218 [_addHashTableEntry](table, key, value) {
219 if (!dart.notNull(_hasTableEntry(table, key))) { 219 if (!dart.notNull(_hasTableEntry(table, key))) {
220 this[_length]++; 220 dart.notNull(this[_length])++;
221 this[_keys] = null; 221 this[_keys] = null;
222 } 222 }
223 _setTableEntry(table, key, value); 223 _setTableEntry(table, key, value);
224 } 224 }
225 [_removeHashTableEntry](table, key) { 225 [_removeHashTableEntry](table, key) {
226 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k ey))) { 226 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k ey))) {
227 let value = dart.as(_getTableEntry(table, key), V); 227 let value = dart.as(_getTableEntry(table, key), V);
228 _deleteTableEntry(table, key); 228 _deleteTableEntry(table, key);
229 this[_length]--; 229 dart.notNull(this[_length])--;
230 this[_keys] = null; 230 this[_keys] = null;
231 return value; 231 return value;
232 } else { 232 } else {
233 return dart.as(null, V); 233 return null;
234 } 234 }
235 } 235 }
236 static [_isStringKey](key) { 236 static [_isStringKey](key) {
237 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k ey, '__proto__')); 237 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k ey, '__proto__'));
238 } 238 }
239 static [_isNumericKey](key) { 239 static [_isNumericKey](key) {
240 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff ffff) === key); 240 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key ;
241 } 241 }
242 [_computeHashCode](key) { 242 [_computeHashCode](key) {
243 return dart.dload(key, 'hashCode') & 0x3ffffff; 243 return dart.dload(key, 'hashCode') & 0x3ffffff;
244 } 244 }
245 static [_hasTableEntry](table, key) { 245 static [_hasTableEntry](table, key) {
246 let entry = table[key]; 246 let entry = table[key];
247 return entry !== null; 247 return entry !== null;
248 } 248 }
249 static [_getTableEntry](table, key) { 249 static [_getTableEntry](table, key) {
250 let entry = table[key]; 250 let entry = table[key];
(...skipping 10 matching lines...) Expand all
261 delete table[key]; 261 delete table[key];
262 } 262 }
263 [_getBucket](table, key) { 263 [_getBucket](table, key) {
264 let hash = this[_computeHashCode](key); 264 let hash = this[_computeHashCode](key);
265 return dart.as(table[hash], core.List); 265 return dart.as(table[hash], core.List);
266 } 266 }
267 [_findBucketIndex](bucket, key) { 267 [_findBucketIndex](bucket, key) {
268 if (bucket === null) 268 if (bucket === null)
269 return -1; 269 return -1;
270 let length = bucket.length; 270 let length = bucket.length;
271 for (let i = 0; i < length; i = 2) { 271 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
272 if (dart.equals(bucket[i], key)) 272 if (dart.equals(bucket[i], key))
273 return i; 273 return i;
274 } 274 }
275 return -1; 275 return -1;
276 } 276 }
277 static [_newHashTable]() { 277 static [_newHashTable]() {
278 let table = Object.create(null); 278 let table = Object.create(null);
279 let temporaryKey = '<non-identifier-key>'; 279 let temporaryKey = '<non-identifier-key>';
280 _setTableEntry(table, temporaryKey, table); 280 _setTableEntry(table, temporaryKey, table);
281 _deleteTableEntry(table, temporaryKey); 281 _deleteTableEntry(table, temporaryKey);
282 return table; 282 return table;
283 } 283 }
284 } 284 }
285 return _HashMap; 285 return _HashMap;
286 }); 286 });
287 let _HashMap = _HashMap$(dynamic, dynamic); 287 let _HashMap = _HashMap$(dynamic, dynamic);
288 let _IdentityHashMap$ = dart.generic(function(K, V) { 288 let _IdentityHashMap$ = dart.generic(function(K, V) {
289 class _IdentityHashMap extends _HashMap$(K, V) { 289 class _IdentityHashMap extends _HashMap$(K, V) {
290 [_computeHashCode](key) { 290 [_computeHashCode](key) {
291 return core.identityHashCode(key) & 0x3ffffff; 291 return core.identityHashCode(key) & 0x3ffffff;
292 } 292 }
293 [_findBucketIndex](bucket, key) { 293 [_findBucketIndex](bucket, key) {
294 if (bucket === null) 294 if (bucket === null)
295 return -1; 295 return -1;
296 let length = bucket.length; 296 let length = bucket.length;
297 for (let i = 0; i < length; i = 2) { 297 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
298 if (core.identical(bucket[i], key)) 298 if (core.identical(bucket[i], key))
299 return i; 299 return i;
300 } 300 }
301 return -1; 301 return -1;
302 } 302 }
303 } 303 }
304 return _IdentityHashMap; 304 return _IdentityHashMap;
305 }); 305 });
306 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic); 306 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic);
307 let _equals = Symbol('_equals'); 307 let _equals = Symbol('_equals');
308 let _hashCode = Symbol('_hashCode'); 308 let _hashCode = Symbol('_hashCode');
309 let _validKey = Symbol('_validKey'); 309 let _validKey = Symbol('_validKey');
310 let _CustomHashMap$ = dart.generic(function(K, V) { 310 let _CustomHashMap$ = dart.generic(function(K, V) {
311 class _CustomHashMap extends _HashMap$(K, V) { 311 class _CustomHashMap extends _HashMap$(K, V) {
312 _CustomHashMap($_equals, $_hashCode, validKey) { 312 _CustomHashMap($_equals, $_hashCode, validKey) {
313 this[_equals] = $_equals; 313 this[_equals] = $_equals;
314 this[_hashCode] = $_hashCode; 314 this[_hashCode] = $_hashCode;
315 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is( v, K), _Predicate); 315 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is( v, K), _Predicate);
316 super._HashMap(); 316 super._HashMap();
317 } 317 }
318 get(key) { 318 get(key) {
319 if (!dart.notNull(this[_validKey](key))) 319 if (!dart.notNull(this[_validKey](key)))
320 return dart.as(null, V); 320 return null;
321 return super._get(key); 321 return super._get(key);
322 } 322 }
323 set(key, value) { 323 set(key, value) {
324 super._set(key, value); 324 super._set(key, value);
325 } 325 }
326 containsKey(key) { 326 containsKey(key) {
327 if (!dart.notNull(this[_validKey](key))) 327 if (!dart.notNull(this[_validKey](key)))
328 return false; 328 return false;
329 return super._containsKey(key); 329 return super._containsKey(key);
330 } 330 }
331 remove(key) { 331 remove(key) {
332 if (!dart.notNull(this[_validKey](key))) 332 if (!dart.notNull(this[_validKey](key)))
333 return dart.as(null, V); 333 return null;
334 return super._remove(key); 334 return super._remove(key);
335 } 335 }
336 [_computeHashCode](key) { 336 [_computeHashCode](key) {
337 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; 337 return this[_hashCode](dart.as(key, K)) & 0x3ffffff;
338 } 338 }
339 [_findBucketIndex](bucket, key) { 339 [_findBucketIndex](bucket, key) {
340 if (bucket === null) 340 if (bucket === null)
341 return -1; 341 return -1;
342 let length = bucket.length; 342 let length = bucket.length;
343 for (let i = 0; i < length; i = 2) { 343 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
344 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K))) 344 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K)))
345 return i; 345 return i;
346 } 346 }
347 return -1; 347 return -1;
348 } 348 }
349 toString() { 349 toString() {
350 return Maps.mapToString(this); 350 return Maps.mapToString(this);
351 } 351 }
352 } 352 }
353 return _CustomHashMap; 353 return _CustomHashMap;
(...skipping 13 matching lines...) Expand all
367 return dart.equals(dart.dload(this[_map], '_length'), 0); 367 return dart.equals(dart.dload(this[_map], '_length'), 0);
368 } 368 }
369 get iterator() { 369 get iterator() {
370 return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map ], '_computeKeys'), core.List)); 370 return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map ], '_computeKeys'), core.List));
371 } 371 }
372 contains(element) { 372 contains(element) {
373 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo ol); 373 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo ol);
374 } 374 }
375 forEach(f) { 375 forEach(f) {
376 let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List); 376 let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List);
377 for (let i = 0, length = keys.length; i < length; i++) { 377 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len gth); dart.notNull(i)++) {
378 f(dart.as(keys[i], E)); 378 f(dart.as(keys[i], E));
379 if (keys !== dart.dload(this[_map], '_keys')) { 379 if (keys !== dart.dload(this[_map], '_keys')) {
380 throw new core.ConcurrentModificationError(this[_map]); 380 throw new core.ConcurrentModificationError(this[_map]);
381 } 381 }
382 } 382 }
383 } 383 }
384 } 384 }
385 return HashMapKeyIterable; 385 return HashMapKeyIterable;
386 }); 386 });
387 let HashMapKeyIterable = HashMapKeyIterable$(dynamic); 387 let HashMapKeyIterable = HashMapKeyIterable$(dynamic);
388 let _offset = Symbol('_offset'); 388 let _offset = Symbol('_offset');
389 let _current = Symbol('_current'); 389 let _current = Symbol('_current');
390 let HashMapKeyIterator$ = dart.generic(function(E) { 390 let HashMapKeyIterator$ = dart.generic(function(E) {
391 class HashMapKeyIterator extends dart.Object { 391 class HashMapKeyIterator extends dart.Object {
392 HashMapKeyIterator($_map, $_keys) { 392 HashMapKeyIterator($_map, $_keys) {
393 this[_map] = $_map; 393 this[_map] = $_map;
394 this[_keys] = $_keys; 394 this[_keys] = $_keys;
395 this[_offset] = 0; 395 this[_offset] = 0;
396 this[_current] = dart.as(null, E); 396 this[_current] = null;
397 } 397 }
398 get current() { 398 get current() {
399 return this[_current]; 399 return this[_current];
400 } 400 }
401 moveNext() { 401 moveNext() {
402 let keys = this[_keys]; 402 let keys = this[_keys];
403 let offset = this[_offset]; 403 let offset = this[_offset];
404 if (keys !== dart.dload(this[_map], '_keys')) { 404 if (keys !== dart.dload(this[_map], '_keys')) {
405 throw new core.ConcurrentModificationError(this[_map]); 405 throw new core.ConcurrentModificationError(this[_map]);
406 } else if (offset >= keys.length) { 406 } else if (dart.notNull(offset) >= keys.length) {
407 this[_current] = dart.as(null, E); 407 this[_current] = null;
408 return false; 408 return false;
409 } else { 409 } else {
410 this[_current] = dart.as(keys[offset], E); 410 this[_current] = dart.as(keys[offset], E);
411 this[_offset] = offset + 1; 411 this[_offset] = dart.notNull(offset) + 1;
412 return true; 412 return true;
413 } 413 }
414 } 414 }
415 } 415 }
416 return HashMapKeyIterator; 416 return HashMapKeyIterator;
417 }); 417 });
418 let HashMapKeyIterator = HashMapKeyIterator$(dynamic); 418 let HashMapKeyIterator = HashMapKeyIterator$(dynamic);
419 let _first = Symbol('_first'); 419 let _first = Symbol('_first');
420 let _last = Symbol('_last'); 420 let _last = Symbol('_last');
421 let _modifications = Symbol('_modifications'); 421 let _modifications = Symbol('_modifications');
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return cell !== null; 467 return cell !== null;
468 } else { 468 } else {
469 return this[_containsKey](key); 469 return this[_containsKey](key);
470 } 470 }
471 } 471 }
472 [_containsKey](key) { 472 [_containsKey](key) {
473 let rest = this[_rest]; 473 let rest = this[_rest];
474 if (rest === null) 474 if (rest === null)
475 return false; 475 return false;
476 let bucket = this[_getBucket](rest, key); 476 let bucket = this[_getBucket](rest, key);
477 return this[_findBucketIndex](bucket, key) >= 0; 477 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
478 } 478 }
479 containsValue(value) { 479 containsValue(value) {
480 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind (this)); 480 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind (this));
481 } 481 }
482 addAll(other) { 482 addAll(other) {
483 other.forEach(((key, value) => { 483 other.forEach(((key, value) => {
484 this.set(key, value); 484 this.set(key, value);
485 }).bind(this)); 485 }).bind(this));
486 } 486 }
487 get(key) { 487 get(key) {
488 if (_isStringKey(key)) { 488 if (_isStringKey(key)) {
489 let strings = this[_strings]; 489 let strings = this[_strings];
490 if (strings === null) 490 if (strings === null)
491 return dart.as(null, V); 491 return null;
492 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); 492 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell);
493 return dart.as(cell === null ? null : cell[_value], V); 493 return dart.as(cell === null ? null : cell[_value], V);
494 } else if (_isNumericKey(key)) { 494 } else if (_isNumericKey(key)) {
495 let nums = this[_nums]; 495 let nums = this[_nums];
496 if (nums === null) 496 if (nums === null)
497 return dart.as(null, V); 497 return null;
498 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); 498 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell);
499 return dart.as(cell === null ? null : cell[_value], V); 499 return dart.as(cell === null ? null : cell[_value], V);
500 } else { 500 } else {
501 return this[_get](key); 501 return this[_get](key);
502 } 502 }
503 } 503 }
504 [_get](key) { 504 [_get](key) {
505 let rest = this[_rest]; 505 let rest = this[_rest];
506 if (rest === null) 506 if (rest === null)
507 return dart.as(null, V); 507 return null;
508 let bucket = this[_getBucket](rest, key); 508 let bucket = this[_getBucket](rest, key);
509 let index = this[_findBucketIndex](bucket, key); 509 let index = this[_findBucketIndex](bucket, key);
510 if (index < 0) 510 if (dart.notNull(index) < 0)
511 return dart.as(null, V); 511 return null;
512 let cell = dart.as(bucket[index], LinkedHashMapCell); 512 let cell = dart.as(bucket[index], LinkedHashMapCell);
513 return dart.as(cell[_value], V); 513 return dart.as(cell[_value], V);
514 } 514 }
515 set(key, value) { 515 set(key, value) {
516 if (_isStringKey(key)) { 516 if (_isStringKey(key)) {
517 let strings = this[_strings]; 517 let strings = this[_strings];
518 if (strings === null) 518 if (strings === null)
519 this[_strings] = strings = _newHashTable(); 519 this[_strings] = strings = _newHashTable();
520 this[_addHashTableEntry](strings, key, value); 520 this[_addHashTableEntry](strings, key, value);
521 } else if (_isNumericKey(key)) { 521 } else if (_isNumericKey(key)) {
522 let nums = this[_nums]; 522 let nums = this[_nums];
523 if (nums === null) 523 if (nums === null)
524 this[_nums] = nums = _newHashTable(); 524 this[_nums] = nums = _newHashTable();
525 this[_addHashTableEntry](nums, key, value); 525 this[_addHashTableEntry](nums, key, value);
526 } else { 526 } else {
527 this[_set](key, value); 527 this[_set](key, value);
528 } 528 }
529 } 529 }
530 [_set](key, value) { 530 [_set](key, value) {
531 let rest = this[_rest]; 531 let rest = this[_rest];
532 if (rest === null) 532 if (rest === null)
533 this[_rest] = rest = _newHashTable(); 533 this[_rest] = rest = _newHashTable();
534 let hash = this[_computeHashCode](key); 534 let hash = this[_computeHashCode](key);
535 let bucket = rest[hash]; 535 let bucket = rest[hash];
536 if (bucket === null) { 536 if (bucket === null) {
537 let cell = this[_newLinkedCell](key, value); 537 let cell = this[_newLinkedCell](key, value);
538 _setTableEntry(rest, hash, [cell]); 538 _setTableEntry(rest, hash, [cell]);
539 } else { 539 } else {
540 let index = this[_findBucketIndex](bucket, key); 540 let index = this[_findBucketIndex](bucket, key);
541 if (index >= 0) { 541 if (dart.notNull(index) >= 0) {
542 let cell = dart.as(bucket[index], LinkedHashMapCell); 542 let cell = dart.as(bucket[index], LinkedHashMapCell);
543 cell[_value] = value; 543 cell[_value] = value;
544 } else { 544 } else {
545 let cell = this[_newLinkedCell](key, value); 545 let cell = this[_newLinkedCell](key, value);
546 bucket.push(cell); 546 bucket.push(cell);
547 } 547 }
548 } 548 }
549 } 549 }
550 putIfAbsent(key, ifAbsent) { 550 putIfAbsent(key, ifAbsent) {
551 if (this.containsKey(key)) 551 if (this.containsKey(key))
552 return this.get(key); 552 return this.get(key);
553 let value = ifAbsent(); 553 let value = ifAbsent();
554 this.set(key, value); 554 this.set(key, value);
555 return value; 555 return value;
556 } 556 }
557 remove(key) { 557 remove(key) {
558 if (_isStringKey(key)) { 558 if (_isStringKey(key)) {
559 return this[_removeHashTableEntry](this[_strings], key); 559 return this[_removeHashTableEntry](this[_strings], key);
560 } else if (_isNumericKey(key)) { 560 } else if (_isNumericKey(key)) {
561 return this[_removeHashTableEntry](this[_nums], key); 561 return this[_removeHashTableEntry](this[_nums], key);
562 } else { 562 } else {
563 return this[_remove](key); 563 return this[_remove](key);
564 } 564 }
565 } 565 }
566 [_remove](key) { 566 [_remove](key) {
567 let rest = this[_rest]; 567 let rest = this[_rest];
568 if (rest === null) 568 if (rest === null)
569 return dart.as(null, V); 569 return null;
570 let bucket = this[_getBucket](rest, key); 570 let bucket = this[_getBucket](rest, key);
571 let index = this[_findBucketIndex](bucket, key); 571 let index = this[_findBucketIndex](bucket, key);
572 if (index < 0) 572 if (dart.notNull(index) < 0)
573 return dart.as(null, V); 573 return null;
574 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); 574 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell);
575 this[_unlinkCell](cell); 575 this[_unlinkCell](cell);
576 return dart.as(cell[_value], V); 576 return dart.as(cell[_value], V);
577 } 577 }
578 clear() { 578 clear() {
579 if (this[_length] > 0) { 579 if (dart.notNull(this[_length]) > 0) {
580 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null; 580 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null;
581 this[_length] = 0; 581 this[_length] = 0;
582 this[_modified](); 582 this[_modified]();
583 } 583 }
584 } 584 }
585 forEach(action) { 585 forEach(action) {
586 let cell = this[_first]; 586 let cell = this[_first];
587 let modifications = this[_modifications]; 587 let modifications = this[_modifications];
588 while (cell !== null) { 588 while (cell !== null) {
589 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); 589 action(dart.as(cell[_key], K), dart.as(cell[_value], V));
590 if (modifications !== this[_modifications]) { 590 if (modifications !== this[_modifications]) {
591 throw new core.ConcurrentModificationError(this); 591 throw new core.ConcurrentModificationError(this);
592 } 592 }
593 cell = cell[_next]; 593 cell = cell[_next];
594 } 594 }
595 } 595 }
596 [_addHashTableEntry](table, key, value) { 596 [_addHashTableEntry](table, key, value) {
597 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); 597 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell);
598 if (cell === null) { 598 if (cell === null) {
599 _setTableEntry(table, key, this[_newLinkedCell](key, value)); 599 _setTableEntry(table, key, this[_newLinkedCell](key, value));
600 } else { 600 } else {
601 cell[_value] = value; 601 cell[_value] = value;
602 } 602 }
603 } 603 }
604 [_removeHashTableEntry](table, key) { 604 [_removeHashTableEntry](table, key) {
605 if (table === null) 605 if (table === null)
606 return dart.as(null, V); 606 return null;
607 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); 607 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell);
608 if (cell === null) 608 if (cell === null)
609 return dart.as(null, V); 609 return null;
610 this[_unlinkCell](cell); 610 this[_unlinkCell](cell);
611 _deleteTableEntry(table, key); 611 _deleteTableEntry(table, key);
612 return dart.as(cell[_value], V); 612 return dart.as(cell[_value], V);
613 } 613 }
614 [_modified]() { 614 [_modified]() {
615 this[_modifications] = this[_modifications] + 1 & 67108863; 615 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ;
616 } 616 }
617 [_newLinkedCell](key, value) { 617 [_newLinkedCell](key, value) {
618 let cell = new LinkedHashMapCell(key, value); 618 let cell = new LinkedHashMapCell(key, value);
619 if (this[_first] === null) { 619 if (this[_first] === null) {
620 this[_first] = this[_last] = cell; 620 this[_first] = this[_last] = cell;
621 } else { 621 } else {
622 let last = this[_last]; 622 let last = this[_last];
623 cell[_previous] = last; 623 cell[_previous] = last;
624 this[_last] = last[_next] = cell; 624 this[_last] = last[_next] = cell;
625 } 625 }
626 this[_length]++; 626 dart.notNull(this[_length])++;
627 this[_modified](); 627 this[_modified]();
628 return cell; 628 return cell;
629 } 629 }
630 [_unlinkCell](cell) { 630 [_unlinkCell](cell) {
631 let previous = cell[_previous]; 631 let previous = cell[_previous];
632 let next = cell[_next]; 632 let next = cell[_next];
633 if (previous === null) { 633 if (previous === null) {
634 dart.assert(dart.equals(cell, this[_first])); 634 dart.assert(dart.equals(cell, this[_first]));
635 this[_first] = next; 635 this[_first] = next;
636 } else { 636 } else {
637 previous[_next] = next; 637 previous[_next] = next;
638 } 638 }
639 if (next === null) { 639 if (next === null) {
640 dart.assert(dart.equals(cell, this[_last])); 640 dart.assert(dart.equals(cell, this[_last]));
641 this[_last] = previous; 641 this[_last] = previous;
642 } else { 642 } else {
643 next[_previous] = previous; 643 next[_previous] = previous;
644 } 644 }
645 this[_length]--; 645 dart.notNull(this[_length])--;
646 this[_modified](); 646 this[_modified]();
647 } 647 }
648 static [_isStringKey](key) { 648 static [_isStringKey](key) {
649 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k ey, '__proto__')); 649 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k ey, '__proto__'));
650 } 650 }
651 static [_isNumericKey](key) { 651 static [_isNumericKey](key) {
652 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff ffff) === key); 652 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key ;
653 } 653 }
654 [_computeHashCode](key) { 654 [_computeHashCode](key) {
655 return dart.dload(key, 'hashCode') & 0x3ffffff; 655 return dart.dload(key, 'hashCode') & 0x3ffffff;
656 } 656 }
657 static [_getTableEntry](table, key) { 657 static [_getTableEntry](table, key) {
658 return table[key]; 658 return table[key];
659 } 659 }
660 static [_setTableEntry](table, key, value) { 660 static [_setTableEntry](table, key, value) {
661 dart.assert(value !== null); 661 dart.assert(value !== null);
662 table[key] = value; 662 table[key] = value;
663 } 663 }
664 static [_deleteTableEntry](table, key) { 664 static [_deleteTableEntry](table, key) {
665 delete table[key]; 665 delete table[key];
666 } 666 }
667 [_getBucket](table, key) { 667 [_getBucket](table, key) {
668 let hash = this[_computeHashCode](key); 668 let hash = this[_computeHashCode](key);
669 return dart.as(table[hash], core.List); 669 return dart.as(table[hash], core.List);
670 } 670 }
671 [_findBucketIndex](bucket, key) { 671 [_findBucketIndex](bucket, key) {
672 if (bucket === null) 672 if (bucket === null)
673 return -1; 673 return -1;
674 let length = bucket.length; 674 let length = bucket.length;
675 for (let i = 0; i < length; i++) { 675 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
676 let cell = dart.as(bucket[i], LinkedHashMapCell); 676 let cell = dart.as(bucket[i], LinkedHashMapCell);
677 if (dart.equals(cell[_key], key)) 677 if (dart.equals(cell[_key], key))
678 return i; 678 return i;
679 } 679 }
680 return -1; 680 return -1;
681 } 681 }
682 static [_newHashTable]() { 682 static [_newHashTable]() {
683 let table = Object.create(null); 683 let table = Object.create(null);
684 let temporaryKey = '<non-identifier-key>'; 684 let temporaryKey = '<non-identifier-key>';
685 _setTableEntry(table, temporaryKey, table); 685 _setTableEntry(table, temporaryKey, table);
686 _deleteTableEntry(table, temporaryKey); 686 _deleteTableEntry(table, temporaryKey);
687 return table; 687 return table;
688 } 688 }
689 toString() { 689 toString() {
690 return Maps.mapToString(this); 690 return Maps.mapToString(this);
691 } 691 }
692 } 692 }
693 return _LinkedHashMap; 693 return _LinkedHashMap;
694 }); 694 });
695 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic); 695 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic);
696 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { 696 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) {
697 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { 697 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) {
698 [_computeHashCode](key) { 698 [_computeHashCode](key) {
699 return core.identityHashCode(key) & 0x3ffffff; 699 return core.identityHashCode(key) & 0x3ffffff;
700 } 700 }
701 [_findBucketIndex](bucket, key) { 701 [_findBucketIndex](bucket, key) {
702 if (bucket === null) 702 if (bucket === null)
703 return -1; 703 return -1;
704 let length = bucket.length; 704 let length = bucket.length;
705 for (let i = 0; i < length; i++) { 705 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
706 let cell = dart.as(bucket[i], LinkedHashMapCell); 706 let cell = dart.as(bucket[i], LinkedHashMapCell);
707 if (core.identical(cell[_key], key)) 707 if (core.identical(cell[_key], key))
708 return i; 708 return i;
709 } 709 }
710 return -1; 710 return -1;
711 } 711 }
712 } 712 }
713 return _LinkedIdentityHashMap; 713 return _LinkedIdentityHashMap;
714 }); 714 });
715 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic); 715 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic);
716 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { 716 let _LinkedCustomHashMap$ = dart.generic(function(K, V) {
717 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { 717 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) {
718 _LinkedCustomHashMap($_equals, $_hashCode, validKey) { 718 _LinkedCustomHashMap($_equals, $_hashCode, validKey) {
719 this[_equals] = $_equals; 719 this[_equals] = $_equals;
720 this[_hashCode] = $_hashCode; 720 this[_hashCode] = $_hashCode;
721 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is( v, K), _Predicate); 721 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is( v, K), _Predicate);
722 super._LinkedHashMap(); 722 super._LinkedHashMap();
723 } 723 }
724 get(key) { 724 get(key) {
725 if (!dart.notNull(this[_validKey](key))) 725 if (!dart.notNull(this[_validKey](key)))
726 return dart.as(null, V); 726 return null;
727 return super._get(key); 727 return super._get(key);
728 } 728 }
729 set(key, value) { 729 set(key, value) {
730 super._set(key, value); 730 super._set(key, value);
731 } 731 }
732 containsKey(key) { 732 containsKey(key) {
733 if (!dart.notNull(this[_validKey](key))) 733 if (!dart.notNull(this[_validKey](key)))
734 return false; 734 return false;
735 return super._containsKey(key); 735 return super._containsKey(key);
736 } 736 }
737 remove(key) { 737 remove(key) {
738 if (!dart.notNull(this[_validKey](key))) 738 if (!dart.notNull(this[_validKey](key)))
739 return dart.as(null, V); 739 return null;
740 return super._remove(key); 740 return super._remove(key);
741 } 741 }
742 [_computeHashCode](key) { 742 [_computeHashCode](key) {
743 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; 743 return this[_hashCode](dart.as(key, K)) & 0x3ffffff;
744 } 744 }
745 [_findBucketIndex](bucket, key) { 745 [_findBucketIndex](bucket, key) {
746 if (bucket === null) 746 if (bucket === null)
747 return -1; 747 return -1;
748 let length = bucket.length; 748 let length = bucket.length;
749 for (let i = 0; i < length; i++) { 749 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
750 let cell = dart.as(bucket[i], LinkedHashMapCell); 750 let cell = dart.as(bucket[i], LinkedHashMapCell);
751 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K))) 751 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K)))
752 return i; 752 return i;
753 } 753 }
754 return -1; 754 return -1;
755 } 755 }
756 } 756 }
757 return _LinkedCustomHashMap; 757 return _LinkedCustomHashMap;
758 }); 758 });
759 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic); 759 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 return LinkedHashMapKeyIterable; 798 return LinkedHashMapKeyIterable;
799 }); 799 });
800 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic); 800 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic);
801 let _cell = Symbol('_cell'); 801 let _cell = Symbol('_cell');
802 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { 802 let LinkedHashMapKeyIterator$ = dart.generic(function(E) {
803 class LinkedHashMapKeyIterator extends dart.Object { 803 class LinkedHashMapKeyIterator extends dart.Object {
804 LinkedHashMapKeyIterator($_map, $_modifications) { 804 LinkedHashMapKeyIterator($_map, $_modifications) {
805 this[_map] = $_map; 805 this[_map] = $_map;
806 this[_modifications] = $_modifications; 806 this[_modifications] = $_modifications;
807 this[_cell] = null; 807 this[_cell] = null;
808 this[_current] = dart.as(null, E); 808 this[_current] = null;
809 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel l); 809 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel l);
810 } 810 }
811 get current() { 811 get current() {
812 return this[_current]; 812 return this[_current];
813 } 813 }
814 moveNext() { 814 moveNext() {
815 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) { 815 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) {
816 throw new core.ConcurrentModificationError(this[_map]); 816 throw new core.ConcurrentModificationError(this[_map]);
817 } else if (this[_cell] === null) { 817 } else if (this[_cell] === null) {
818 this[_current] = dart.as(null, E); 818 this[_current] = null;
819 return false; 819 return false;
820 } else { 820 } else {
821 this[_current] = dart.as(this[_cell][_key], E); 821 this[_current] = dart.as(this[_cell][_key], E);
822 this[_cell] = this[_cell][_next]; 822 this[_cell] = this[_cell][_next];
823 return true; 823 return true;
824 } 824 }
825 } 825 }
826 } 826 }
827 return LinkedHashMapKeyIterator; 827 return LinkedHashMapKeyIterator;
828 }); 828 });
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 return nums === null ? false : _hasTableEntry(nums, object); 869 return nums === null ? false : _hasTableEntry(nums, object);
870 } else { 870 } else {
871 return this[_contains](object); 871 return this[_contains](object);
872 } 872 }
873 } 873 }
874 [_contains](object) { 874 [_contains](object) {
875 let rest = this[_rest]; 875 let rest = this[_rest];
876 if (rest === null) 876 if (rest === null)
877 return false; 877 return false;
878 let bucket = this[_getBucket](rest, object); 878 let bucket = this[_getBucket](rest, object);
879 return this[_findBucketIndex](bucket, object) >= 0; 879 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0;
880 } 880 }
881 lookup(object) { 881 lookup(object) {
882 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle ment(object))) { 882 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle ment(object))) {
883 return dart.as(this.contains(object) ? object : null, E); 883 return dart.as(this.contains(object) ? object : null, E);
884 } 884 }
885 return this[_lookup](object); 885 return this[_lookup](object);
886 } 886 }
887 [_lookup](object) { 887 [_lookup](object) {
888 let rest = this[_rest]; 888 let rest = this[_rest];
889 if (rest === null) 889 if (rest === null)
890 return dart.as(null, E); 890 return null;
891 let bucket = this[_getBucket](rest, object); 891 let bucket = this[_getBucket](rest, object);
892 let index = this[_findBucketIndex](bucket, object); 892 let index = this[_findBucketIndex](bucket, object);
893 if (index < 0) 893 if (dart.notNull(index) < 0)
894 return dart.as(null, E); 894 return null;
895 return dart.as(bucket.get(index), E); 895 return dart.as(bucket.get(index), E);
896 } 896 }
897 add(element) { 897 add(element) {
898 if (_isStringElement(element)) { 898 if (_isStringElement(element)) {
899 let strings = this[_strings]; 899 let strings = this[_strings];
900 if (strings === null) 900 if (strings === null)
901 this[_strings] = strings = _newHashTable(); 901 this[_strings] = strings = _newHashTable();
902 return this[_addHashTableEntry](strings, element); 902 return this[_addHashTableEntry](strings, element);
903 } else if (_isNumericElement(element)) { 903 } else if (_isNumericElement(element)) {
904 let nums = this[_nums]; 904 let nums = this[_nums];
905 if (nums === null) 905 if (nums === null)
906 this[_nums] = nums = _newHashTable(); 906 this[_nums] = nums = _newHashTable();
907 return this[_addHashTableEntry](nums, element); 907 return this[_addHashTableEntry](nums, element);
908 } else { 908 } else {
909 return this[_add](element); 909 return this[_add](element);
910 } 910 }
911 } 911 }
912 [_add](element) { 912 [_add](element) {
913 let rest = this[_rest]; 913 let rest = this[_rest];
914 if (rest === null) 914 if (rest === null)
915 this[_rest] = rest = _newHashTable(); 915 this[_rest] = rest = _newHashTable();
916 let hash = this[_computeHashCode](element); 916 let hash = this[_computeHashCode](element);
917 let bucket = rest[hash]; 917 let bucket = rest[hash];
918 if (bucket === null) { 918 if (bucket === null) {
919 _setTableEntry(rest, hash, [element]); 919 _setTableEntry(rest, hash, [element]);
920 } else { 920 } else {
921 let index = this[_findBucketIndex](bucket, element); 921 let index = this[_findBucketIndex](bucket, element);
922 if (index >= 0) 922 if (dart.notNull(index) >= 0)
923 return false; 923 return false;
924 bucket.push(element); 924 bucket.push(element);
925 } 925 }
926 this[_length]++; 926 dart.notNull(this[_length])++;
927 this[_elements] = null; 927 this[_elements] = null;
928 return true; 928 return true;
929 } 929 }
930 addAll(objects) { 930 addAll(objects) {
931 for (let each of objects) { 931 for (let each of objects) {
932 this.add(each); 932 this.add(each);
933 } 933 }
934 } 934 }
935 remove(object) { 935 remove(object) {
936 if (_isStringElement(object)) { 936 if (_isStringElement(object)) {
937 return this[_removeHashTableEntry](this[_strings], object); 937 return this[_removeHashTableEntry](this[_strings], object);
938 } else if (_isNumericElement(object)) { 938 } else if (_isNumericElement(object)) {
939 return this[_removeHashTableEntry](this[_nums], object); 939 return this[_removeHashTableEntry](this[_nums], object);
940 } else { 940 } else {
941 return this[_remove](object); 941 return this[_remove](object);
942 } 942 }
943 } 943 }
944 [_remove](object) { 944 [_remove](object) {
945 let rest = this[_rest]; 945 let rest = this[_rest];
946 if (rest === null) 946 if (rest === null)
947 return false; 947 return false;
948 let bucket = this[_getBucket](rest, object); 948 let bucket = this[_getBucket](rest, object);
949 let index = this[_findBucketIndex](bucket, object); 949 let index = this[_findBucketIndex](bucket, object);
950 if (index < 0) 950 if (dart.notNull(index) < 0)
951 return false; 951 return false;
952 this[_length]--; 952 dart.notNull(this[_length])--;
953 this[_elements] = null; 953 this[_elements] = null;
954 bucket.splice(index, 1); 954 bucket.splice(index, 1);
955 return true; 955 return true;
956 } 956 }
957 clear() { 957 clear() {
958 if (this[_length] > 0) { 958 if (dart.notNull(this[_length]) > 0) {
959 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null; 959 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null;
960 this[_length] = 0; 960 this[_length] = 0;
961 } 961 }
962 } 962 }
963 [_computeElements]() { 963 [_computeElements]() {
964 if (this[_elements] !== null) 964 if (this[_elements] !== null)
965 return this[_elements]; 965 return this[_elements];
966 let result = new core.List(this[_length]); 966 let result = new core.List(this[_length]);
967 let index = 0; 967 let index = 0;
968 let strings = this[_strings]; 968 let strings = this[_strings];
969 if (strings !== null) { 969 if (strings !== null) {
970 let names = Object.getOwnPropertyNames(strings); 970 let names = Object.getOwnPropertyNames(strings);
971 let entries = names.length; 971 let entries = names.length;
972 for (let i = 0; i < entries; i++) { 972 for (let i = 0; dart.notNull(i) < dart.notNull(entries); dart.notNull( i)++) {
973 let element = names[i]; 973 let element = names[i];
974 result[index] = element; 974 result[index] = element;
975 index++; 975 dart.notNull(index)++;
976 } 976 }
977 } 977 }
978 let nums = this[_nums]; 978 let nums = this[_nums];
979 if (nums !== null) { 979 if (nums !== null) {
980 let names = Object.getOwnPropertyNames(nums); 980 let names = Object.getOwnPropertyNames(nums);
981 let entries = names.length; 981 let entries = names.length;
982 for (let i = 0; i < entries; i++) { 982 for (let i = 0; dart.notNull(i) < dart.notNull(entries); dart.notNull( i)++) {
983 let element = +names[i]; 983 let element = +names[i];
984 result[index] = element; 984 result[index] = element;
985 index++; 985 dart.notNull(index)++;
986 } 986 }
987 } 987 }
988 let rest = this[_rest]; 988 let rest = this[_rest];
989 if (rest !== null) { 989 if (rest !== null) {
990 let names = Object.getOwnPropertyNames(rest); 990 let names = Object.getOwnPropertyNames(rest);
991 let entries = names.length; 991 let entries = names.length;
992 for (let i = 0; i < entries; i++) { 992 for (let i = 0; dart.notNull(i) < dart.notNull(entries); dart.notNull( i)++) {
993 let entry = names[i]; 993 let entry = names[i];
994 let bucket = rest[entry]; 994 let bucket = rest[entry];
995 let length = bucket.length; 995 let length = bucket.length;
996 for (let i = 0; i < length; i++) { 996 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull (i)++) {
997 result[index] = bucket[i]; 997 result[index] = bucket[i];
998 index++; 998 dart.notNull(index)++;
999 } 999 }
1000 } 1000 }
1001 } 1001 }
1002 dart.assert(index === this[_length]); 1002 dart.assert(index === this[_length]);
1003 return this[_elements] = result; 1003 return this[_elements] = result;
1004 } 1004 }
1005 [_addHashTableEntry](table, element) { 1005 [_addHashTableEntry](table, element) {
1006 if (_hasTableEntry(table, element)) 1006 if (_hasTableEntry(table, element))
1007 return false; 1007 return false;
1008 _setTableEntry(table, element, 0); 1008 _setTableEntry(table, element, 0);
1009 this[_length]++; 1009 dart.notNull(this[_length])++;
1010 this[_elements] = null; 1010 this[_elements] = null;
1011 return true; 1011 return true;
1012 } 1012 }
1013 [_removeHashTableEntry](table, element) { 1013 [_removeHashTableEntry](table, element) {
1014 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e lement))) { 1014 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e lement))) {
1015 _deleteTableEntry(table, element); 1015 _deleteTableEntry(table, element);
1016 this[_length]--; 1016 dart.notNull(this[_length])--;
1017 this[_elements] = null; 1017 this[_elements] = null;
1018 return true; 1018 return true;
1019 } else { 1019 } else {
1020 return false; 1020 return false;
1021 } 1021 }
1022 } 1022 }
1023 static [_isStringElement](element) { 1023 static [_isStringElement](element) {
1024 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa ls(element, '__proto__')); 1024 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa ls(element, '__proto__'));
1025 } 1025 }
1026 static [_isNumericElement](element) { 1026 static [_isNumericElement](element) {
1027 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element & 0x3ffffff) === element); 1027 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element;
1028 } 1028 }
1029 [_computeHashCode](element) { 1029 [_computeHashCode](element) {
1030 return dart.dload(element, 'hashCode') & 0x3ffffff; 1030 return dart.dload(element, 'hashCode') & 0x3ffffff;
1031 } 1031 }
1032 static [_hasTableEntry](table, key) { 1032 static [_hasTableEntry](table, key) {
1033 let entry = table[key]; 1033 let entry = table[key];
1034 return entry !== null; 1034 return entry !== null;
1035 } 1035 }
1036 static [_setTableEntry](table, key, value) { 1036 static [_setTableEntry](table, key, value) {
1037 dart.assert(value !== null); 1037 dart.assert(value !== null);
1038 table[key] = value; 1038 table[key] = value;
1039 } 1039 }
1040 static [_deleteTableEntry](table, key) { 1040 static [_deleteTableEntry](table, key) {
1041 delete table[key]; 1041 delete table[key];
1042 } 1042 }
1043 [_getBucket](table, element) { 1043 [_getBucket](table, element) {
1044 let hash = this[_computeHashCode](element); 1044 let hash = this[_computeHashCode](element);
1045 return dart.as(table[hash], core.List); 1045 return dart.as(table[hash], core.List);
1046 } 1046 }
1047 [_findBucketIndex](bucket, element) { 1047 [_findBucketIndex](bucket, element) {
1048 if (bucket === null) 1048 if (bucket === null)
1049 return -1; 1049 return -1;
1050 let length = bucket.length; 1050 let length = bucket.length;
1051 for (let i = 0; i < length; i++) { 1051 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
1052 if (dart.equals(bucket[i], element)) 1052 if (dart.equals(bucket[i], element))
1053 return i; 1053 return i;
1054 } 1054 }
1055 return -1; 1055 return -1;
1056 } 1056 }
1057 static [_newHashTable]() { 1057 static [_newHashTable]() {
1058 let table = Object.create(null); 1058 let table = Object.create(null);
1059 let temporaryKey = '<non-identifier-key>'; 1059 let temporaryKey = '<non-identifier-key>';
1060 _setTableEntry(table, temporaryKey, table); 1060 _setTableEntry(table, temporaryKey, table);
1061 _deleteTableEntry(table, temporaryKey); 1061 _deleteTableEntry(table, temporaryKey);
1062 return table; 1062 return table;
1063 } 1063 }
1064 } 1064 }
1065 return _HashSet; 1065 return _HashSet;
1066 }); 1066 });
1067 let _HashSet = _HashSet$(dynamic); 1067 let _HashSet = _HashSet$(dynamic);
1068 let _IdentityHashSet$ = dart.generic(function(E) { 1068 let _IdentityHashSet$ = dart.generic(function(E) {
1069 class _IdentityHashSet extends _HashSet$(E) { 1069 class _IdentityHashSet extends _HashSet$(E) {
1070 [_newSet]() { 1070 [_newSet]() {
1071 return new _IdentityHashSet(); 1071 return new _IdentityHashSet();
1072 } 1072 }
1073 [_computeHashCode](key) { 1073 [_computeHashCode](key) {
1074 return core.identityHashCode(key) & 0x3ffffff; 1074 return core.identityHashCode(key) & 0x3ffffff;
1075 } 1075 }
1076 [_findBucketIndex](bucket, element) { 1076 [_findBucketIndex](bucket, element) {
1077 if (bucket === null) 1077 if (bucket === null)
1078 return -1; 1078 return -1;
1079 let length = bucket.length; 1079 let length = bucket.length;
1080 for (let i = 0; i < length; i++) { 1080 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
1081 if (core.identical(bucket[i], element)) 1081 if (core.identical(bucket[i], element))
1082 return i; 1082 return i;
1083 } 1083 }
1084 return -1; 1084 return -1;
1085 } 1085 }
1086 } 1086 }
1087 return _IdentityHashSet; 1087 return _IdentityHashSet;
1088 }); 1088 });
1089 let _IdentityHashSet = _IdentityHashSet$(dynamic); 1089 let _IdentityHashSet = _IdentityHashSet$(dynamic);
1090 let _equality = Symbol('_equality'); 1090 let _equality = Symbol('_equality');
1091 let _hasher = Symbol('_hasher'); 1091 let _hasher = Symbol('_hasher');
1092 let _CustomHashSet$ = dart.generic(function(E) { 1092 let _CustomHashSet$ = dart.generic(function(E) {
1093 class _CustomHashSet extends _HashSet$(E) { 1093 class _CustomHashSet extends _HashSet$(E) {
1094 _CustomHashSet($_equality, $_hasher, validKey) { 1094 _CustomHashSet($_equality, $_hasher, validKey) {
1095 this[_equality] = $_equality; 1095 this[_equality] = $_equality;
1096 this[_hasher] = $_hasher; 1096 this[_hasher] = $_hasher;
1097 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is( x, E), _Predicate); 1097 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is( x, E), _Predicate);
1098 super._HashSet(); 1098 super._HashSet();
1099 } 1099 }
1100 [_newSet]() { 1100 [_newSet]() {
1101 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey ]); 1101 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey ]);
1102 } 1102 }
1103 [_findBucketIndex](bucket, element) { 1103 [_findBucketIndex](bucket, element) {
1104 if (bucket === null) 1104 if (bucket === null)
1105 return -1; 1105 return -1;
1106 let length = bucket.length; 1106 let length = bucket.length;
1107 for (let i = 0; i < length; i++) { 1107 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
1108 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) 1108 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E)))
1109 return i; 1109 return i;
1110 } 1110 }
1111 return -1; 1111 return -1;
1112 } 1112 }
1113 [_computeHashCode](element) { 1113 [_computeHashCode](element) {
1114 return this[_hasher](dart.as(element, E)) & 0x3ffffff; 1114 return this[_hasher](dart.as(element, E)) & 0x3ffffff;
1115 } 1115 }
1116 add(object) { 1116 add(object) {
1117 return super._add(object); 1117 return super._add(object);
1118 } 1118 }
1119 contains(object) { 1119 contains(object) {
1120 if (!dart.notNull(this[_validKey](object))) 1120 if (!dart.notNull(this[_validKey](object)))
1121 return false; 1121 return false;
1122 return super._contains(object); 1122 return super._contains(object);
1123 } 1123 }
1124 lookup(object) { 1124 lookup(object) {
1125 if (!dart.notNull(this[_validKey](object))) 1125 if (!dart.notNull(this[_validKey](object)))
1126 return dart.as(null, E); 1126 return null;
1127 return super._lookup(object); 1127 return super._lookup(object);
1128 } 1128 }
1129 remove(object) { 1129 remove(object) {
1130 if (!dart.notNull(this[_validKey](object))) 1130 if (!dart.notNull(this[_validKey](object)))
1131 return false; 1131 return false;
1132 return super._remove(object); 1132 return super._remove(object);
1133 } 1133 }
1134 } 1134 }
1135 return _CustomHashSet; 1135 return _CustomHashSet;
1136 }); 1136 });
1137 let _CustomHashSet = _CustomHashSet$(dynamic); 1137 let _CustomHashSet = _CustomHashSet$(dynamic);
1138 let HashSetIterator$ = dart.generic(function(E) { 1138 let HashSetIterator$ = dart.generic(function(E) {
1139 class HashSetIterator extends dart.Object { 1139 class HashSetIterator extends dart.Object {
1140 HashSetIterator($_set, $_elements) { 1140 HashSetIterator($_set, $_elements) {
1141 this[_set] = $_set; 1141 this[_set] = $_set;
1142 this[_elements] = $_elements; 1142 this[_elements] = $_elements;
1143 this[_offset] = 0; 1143 this[_offset] = 0;
1144 this[_current] = dart.as(null, E); 1144 this[_current] = null;
1145 } 1145 }
1146 get current() { 1146 get current() {
1147 return this[_current]; 1147 return this[_current];
1148 } 1148 }
1149 moveNext() { 1149 moveNext() {
1150 let elements = this[_elements]; 1150 let elements = this[_elements];
1151 let offset = this[_offset]; 1151 let offset = this[_offset];
1152 if (elements !== dart.dload(this[_set], '_elements')) { 1152 if (elements !== dart.dload(this[_set], '_elements')) {
1153 throw new core.ConcurrentModificationError(this[_set]); 1153 throw new core.ConcurrentModificationError(this[_set]);
1154 } else if (offset >= elements.length) { 1154 } else if (dart.notNull(offset) >= elements.length) {
1155 this[_current] = dart.as(null, E); 1155 this[_current] = null;
1156 return false; 1156 return false;
1157 } else { 1157 } else {
1158 this[_current] = dart.as(elements[offset], E); 1158 this[_current] = dart.as(elements[offset], E);
1159 this[_offset] = offset + 1; 1159 this[_offset] = dart.notNull(offset) + 1;
1160 return true; 1160 return true;
1161 } 1161 }
1162 } 1162 }
1163 } 1163 }
1164 return HashSetIterator; 1164 return HashSetIterator;
1165 }); 1165 });
1166 let HashSetIterator = HashSetIterator$(dynamic); 1166 let HashSetIterator = HashSetIterator$(dynamic);
1167 let _unsupported = Symbol('_unsupported'); 1167 let _unsupported = Symbol('_unsupported');
1168 let _element = Symbol('_element'); 1168 let _element = Symbol('_element');
1169 let _filterWhere = Symbol('_filterWhere'); 1169 let _filterWhere = Symbol('_filterWhere');
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 return cell !== null; 1212 return cell !== null;
1213 } else { 1213 } else {
1214 return this[_contains](object); 1214 return this[_contains](object);
1215 } 1215 }
1216 } 1216 }
1217 [_contains](object) { 1217 [_contains](object) {
1218 let rest = this[_rest]; 1218 let rest = this[_rest];
1219 if (rest === null) 1219 if (rest === null)
1220 return false; 1220 return false;
1221 let bucket = this[_getBucket](rest, object); 1221 let bucket = this[_getBucket](rest, object);
1222 return this[_findBucketIndex](bucket, object) >= 0; 1222 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0;
1223 } 1223 }
1224 lookup(object) { 1224 lookup(object) {
1225 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle ment(object))) { 1225 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle ment(object))) {
1226 return dart.as(this.contains(object) ? object : null, E); 1226 return dart.as(this.contains(object) ? object : null, E);
1227 } else { 1227 } else {
1228 return this[_lookup](object); 1228 return this[_lookup](object);
1229 } 1229 }
1230 } 1230 }
1231 [_lookup](object) { 1231 [_lookup](object) {
1232 let rest = this[_rest]; 1232 let rest = this[_rest];
1233 if (rest === null) 1233 if (rest === null)
1234 return dart.as(null, E); 1234 return null;
1235 let bucket = this[_getBucket](rest, object); 1235 let bucket = this[_getBucket](rest, object);
1236 let index = this[_findBucketIndex](bucket, object); 1236 let index = this[_findBucketIndex](bucket, object);
1237 if (index < 0) 1237 if (dart.notNull(index) < 0)
1238 return dart.as(null, E); 1238 return null;
1239 return dart.as(dart.dload(bucket.get(index), '_element'), E); 1239 return dart.as(dart.dload(bucket.get(index), '_element'), E);
1240 } 1240 }
1241 forEach(action) { 1241 forEach(action) {
1242 let cell = this[_first]; 1242 let cell = this[_first];
1243 let modifications = this[_modifications]; 1243 let modifications = this[_modifications];
1244 while (cell !== null) { 1244 while (cell !== null) {
1245 action(dart.as(cell[_element], E)); 1245 action(dart.as(cell[_element], E));
1246 if (modifications !== this[_modifications]) { 1246 if (modifications !== this[_modifications]) {
1247 throw new core.ConcurrentModificationError(this); 1247 throw new core.ConcurrentModificationError(this);
1248 } 1248 }
(...skipping 29 matching lines...) Expand all
1278 let rest = this[_rest]; 1278 let rest = this[_rest];
1279 if (rest === null) 1279 if (rest === null)
1280 this[_rest] = rest = _newHashTable(); 1280 this[_rest] = rest = _newHashTable();
1281 let hash = this[_computeHashCode](element); 1281 let hash = this[_computeHashCode](element);
1282 let bucket = rest[hash]; 1282 let bucket = rest[hash];
1283 if (bucket === null) { 1283 if (bucket === null) {
1284 let cell = this[_newLinkedCell](element); 1284 let cell = this[_newLinkedCell](element);
1285 _setTableEntry(rest, hash, [cell]); 1285 _setTableEntry(rest, hash, [cell]);
1286 } else { 1286 } else {
1287 let index = this[_findBucketIndex](bucket, element); 1287 let index = this[_findBucketIndex](bucket, element);
1288 if (index >= 0) 1288 if (dart.notNull(index) >= 0)
1289 return false; 1289 return false;
1290 let cell = this[_newLinkedCell](element); 1290 let cell = this[_newLinkedCell](element);
1291 bucket.push(cell); 1291 bucket.push(cell);
1292 } 1292 }
1293 return true; 1293 return true;
1294 } 1294 }
1295 remove(object) { 1295 remove(object) {
1296 if (_isStringElement(object)) { 1296 if (_isStringElement(object)) {
1297 return this[_removeHashTableEntry](this[_strings], object); 1297 return this[_removeHashTableEntry](this[_strings], object);
1298 } else if (_isNumericElement(object)) { 1298 } else if (_isNumericElement(object)) {
1299 return this[_removeHashTableEntry](this[_nums], object); 1299 return this[_removeHashTableEntry](this[_nums], object);
1300 } else { 1300 } else {
1301 return this[_remove](object); 1301 return this[_remove](object);
1302 } 1302 }
1303 } 1303 }
1304 [_remove](object) { 1304 [_remove](object) {
1305 let rest = this[_rest]; 1305 let rest = this[_rest];
1306 if (rest === null) 1306 if (rest === null)
1307 return false; 1307 return false;
1308 let bucket = this[_getBucket](rest, object); 1308 let bucket = this[_getBucket](rest, object);
1309 let index = this[_findBucketIndex](bucket, object); 1309 let index = this[_findBucketIndex](bucket, object);
1310 if (index < 0) 1310 if (dart.notNull(index) < 0)
1311 return false; 1311 return false;
1312 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); 1312 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell);
1313 this[_unlinkCell](cell); 1313 this[_unlinkCell](cell);
1314 return true; 1314 return true;
1315 } 1315 }
1316 removeWhere(test) { 1316 removeWhere(test) {
1317 this[_filterWhere](test, true); 1317 this[_filterWhere](test, true);
1318 } 1318 }
1319 retainWhere(test) { 1319 retainWhere(test) {
1320 this[_filterWhere](test, false); 1320 this[_filterWhere](test, false);
1321 } 1321 }
1322 [_filterWhere](test, removeMatching) { 1322 [_filterWhere](test, removeMatching) {
1323 let cell = this[_first]; 1323 let cell = this[_first];
1324 while (cell !== null) { 1324 while (cell !== null) {
1325 let element = dart.as(cell[_element], E); 1325 let element = dart.as(cell[_element], E);
1326 let next = cell[_next]; 1326 let next = cell[_next];
1327 let modifications = this[_modifications]; 1327 let modifications = this[_modifications];
1328 let shouldRemove = removeMatching === test(element); 1328 let shouldRemove = removeMatching === test(element);
1329 if (modifications !== this[_modifications]) { 1329 if (modifications !== this[_modifications]) {
1330 throw new core.ConcurrentModificationError(this); 1330 throw new core.ConcurrentModificationError(this);
1331 } 1331 }
1332 if (shouldRemove) 1332 if (shouldRemove)
1333 this.remove(element); 1333 this.remove(element);
1334 cell = next; 1334 cell = next;
1335 } 1335 }
1336 } 1336 }
1337 clear() { 1337 clear() {
1338 if (this[_length] > 0) { 1338 if (dart.notNull(this[_length]) > 0) {
1339 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null; 1339 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null;
1340 this[_length] = 0; 1340 this[_length] = 0;
1341 this[_modified](); 1341 this[_modified]();
1342 } 1342 }
1343 } 1343 }
1344 [_addHashTableEntry](table, element) { 1344 [_addHashTableEntry](table, element) {
1345 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); 1345 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell);
1346 if (cell !== null) 1346 if (cell !== null)
1347 return false; 1347 return false;
1348 _setTableEntry(table, element, this[_newLinkedCell](element)); 1348 _setTableEntry(table, element, this[_newLinkedCell](element));
1349 return true; 1349 return true;
1350 } 1350 }
1351 [_removeHashTableEntry](table, element) { 1351 [_removeHashTableEntry](table, element) {
1352 if (table === null) 1352 if (table === null)
1353 return false; 1353 return false;
1354 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); 1354 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell);
1355 if (cell === null) 1355 if (cell === null)
1356 return false; 1356 return false;
1357 this[_unlinkCell](cell); 1357 this[_unlinkCell](cell);
1358 _deleteTableEntry(table, element); 1358 _deleteTableEntry(table, element);
1359 return true; 1359 return true;
1360 } 1360 }
1361 [_modified]() { 1361 [_modified]() {
1362 this[_modifications] = this[_modifications] + 1 & 67108863; 1362 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ;
1363 } 1363 }
1364 [_newLinkedCell](element) { 1364 [_newLinkedCell](element) {
1365 let cell = new LinkedHashSetCell(element); 1365 let cell = new LinkedHashSetCell(element);
1366 if (this[_first] === null) { 1366 if (this[_first] === null) {
1367 this[_first] = this[_last] = cell; 1367 this[_first] = this[_last] = cell;
1368 } else { 1368 } else {
1369 let last = this[_last]; 1369 let last = this[_last];
1370 cell[_previous] = last; 1370 cell[_previous] = last;
1371 this[_last] = last[_next] = cell; 1371 this[_last] = last[_next] = cell;
1372 } 1372 }
1373 this[_length]++; 1373 dart.notNull(this[_length])++;
1374 this[_modified](); 1374 this[_modified]();
1375 return cell; 1375 return cell;
1376 } 1376 }
1377 [_unlinkCell](cell) { 1377 [_unlinkCell](cell) {
1378 let previous = cell[_previous]; 1378 let previous = cell[_previous];
1379 let next = cell[_next]; 1379 let next = cell[_next];
1380 if (previous === null) { 1380 if (previous === null) {
1381 dart.assert(dart.equals(cell, this[_first])); 1381 dart.assert(dart.equals(cell, this[_first]));
1382 this[_first] = next; 1382 this[_first] = next;
1383 } else { 1383 } else {
1384 previous[_next] = next; 1384 previous[_next] = next;
1385 } 1385 }
1386 if (next === null) { 1386 if (next === null) {
1387 dart.assert(dart.equals(cell, this[_last])); 1387 dart.assert(dart.equals(cell, this[_last]));
1388 this[_last] = previous; 1388 this[_last] = previous;
1389 } else { 1389 } else {
1390 next[_previous] = previous; 1390 next[_previous] = previous;
1391 } 1391 }
1392 this[_length]--; 1392 dart.notNull(this[_length])--;
1393 this[_modified](); 1393 this[_modified]();
1394 } 1394 }
1395 static [_isStringElement](element) { 1395 static [_isStringElement](element) {
1396 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa ls(element, '__proto__')); 1396 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa ls(element, '__proto__'));
1397 } 1397 }
1398 static [_isNumericElement](element) { 1398 static [_isNumericElement](element) {
1399 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element & 0x3ffffff) === element); 1399 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element;
1400 } 1400 }
1401 [_computeHashCode](element) { 1401 [_computeHashCode](element) {
1402 return dart.dload(element, 'hashCode') & 0x3ffffff; 1402 return dart.dload(element, 'hashCode') & 0x3ffffff;
1403 } 1403 }
1404 static [_getTableEntry](table, key) { 1404 static [_getTableEntry](table, key) {
1405 return table[key]; 1405 return table[key];
1406 } 1406 }
1407 static [_setTableEntry](table, key, value) { 1407 static [_setTableEntry](table, key, value) {
1408 dart.assert(value !== null); 1408 dart.assert(value !== null);
1409 table[key] = value; 1409 table[key] = value;
1410 } 1410 }
1411 static [_deleteTableEntry](table, key) { 1411 static [_deleteTableEntry](table, key) {
1412 delete table[key]; 1412 delete table[key];
1413 } 1413 }
1414 [_getBucket](table, element) { 1414 [_getBucket](table, element) {
1415 let hash = this[_computeHashCode](element); 1415 let hash = this[_computeHashCode](element);
1416 return dart.as(table[hash], core.List); 1416 return dart.as(table[hash], core.List);
1417 } 1417 }
1418 [_findBucketIndex](bucket, element) { 1418 [_findBucketIndex](bucket, element) {
1419 if (bucket === null) 1419 if (bucket === null)
1420 return -1; 1420 return -1;
1421 let length = bucket.length; 1421 let length = bucket.length;
1422 for (let i = 0; i < length; i++) { 1422 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
1423 let cell = dart.as(bucket[i], LinkedHashSetCell); 1423 let cell = dart.as(bucket[i], LinkedHashSetCell);
1424 if (dart.equals(cell[_element], element)) 1424 if (dart.equals(cell[_element], element))
1425 return i; 1425 return i;
1426 } 1426 }
1427 return -1; 1427 return -1;
1428 } 1428 }
1429 static [_newHashTable]() { 1429 static [_newHashTable]() {
1430 let table = Object.create(null); 1430 let table = Object.create(null);
1431 let temporaryKey = '<non-identifier-key>'; 1431 let temporaryKey = '<non-identifier-key>';
1432 _setTableEntry(table, temporaryKey, table); 1432 _setTableEntry(table, temporaryKey, table);
1433 _deleteTableEntry(table, temporaryKey); 1433 _deleteTableEntry(table, temporaryKey);
1434 return table; 1434 return table;
1435 } 1435 }
1436 } 1436 }
1437 return _LinkedHashSet; 1437 return _LinkedHashSet;
1438 }); 1438 });
1439 let _LinkedHashSet = _LinkedHashSet$(dynamic); 1439 let _LinkedHashSet = _LinkedHashSet$(dynamic);
1440 let _LinkedIdentityHashSet$ = dart.generic(function(E) { 1440 let _LinkedIdentityHashSet$ = dart.generic(function(E) {
1441 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { 1441 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) {
1442 [_newSet]() { 1442 [_newSet]() {
1443 return new _LinkedIdentityHashSet(); 1443 return new _LinkedIdentityHashSet();
1444 } 1444 }
1445 [_computeHashCode](key) { 1445 [_computeHashCode](key) {
1446 return core.identityHashCode(key) & 0x3ffffff; 1446 return core.identityHashCode(key) & 0x3ffffff;
1447 } 1447 }
1448 [_findBucketIndex](bucket, element) { 1448 [_findBucketIndex](bucket, element) {
1449 if (bucket === null) 1449 if (bucket === null)
1450 return -1; 1450 return -1;
1451 let length = bucket.length; 1451 let length = bucket.length;
1452 for (let i = 0; i < length; i++) { 1452 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
1453 let cell = dart.as(bucket[i], LinkedHashSetCell); 1453 let cell = dart.as(bucket[i], LinkedHashSetCell);
1454 if (core.identical(cell[_element], element)) 1454 if (core.identical(cell[_element], element))
1455 return i; 1455 return i;
1456 } 1456 }
1457 return -1; 1457 return -1;
1458 } 1458 }
1459 } 1459 }
1460 return _LinkedIdentityHashSet; 1460 return _LinkedIdentityHashSet;
1461 }); 1461 });
1462 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic); 1462 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic);
1463 let _LinkedCustomHashSet$ = dart.generic(function(E) { 1463 let _LinkedCustomHashSet$ = dart.generic(function(E) {
1464 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { 1464 class _LinkedCustomHashSet extends _LinkedHashSet$(E) {
1465 _LinkedCustomHashSet($_equality, $_hasher, validKey) { 1465 _LinkedCustomHashSet($_equality, $_hasher, validKey) {
1466 this[_equality] = $_equality; 1466 this[_equality] = $_equality;
1467 this[_hasher] = $_hasher; 1467 this[_hasher] = $_hasher;
1468 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is( x, E), _Predicate); 1468 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is( x, E), _Predicate);
1469 super._LinkedHashSet(); 1469 super._LinkedHashSet();
1470 } 1470 }
1471 [_newSet]() { 1471 [_newSet]() {
1472 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va lidKey]); 1472 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va lidKey]);
1473 } 1473 }
1474 [_findBucketIndex](bucket, element) { 1474 [_findBucketIndex](bucket, element) {
1475 if (bucket === null) 1475 if (bucket === null)
1476 return -1; 1476 return -1;
1477 let length = bucket.length; 1477 let length = bucket.length;
1478 for (let i = 0; i < length; i++) { 1478 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
1479 let cell = dart.as(bucket[i], LinkedHashSetCell); 1479 let cell = dart.as(bucket[i], LinkedHashSetCell);
1480 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) 1480 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E)))
1481 return i; 1481 return i;
1482 } 1482 }
1483 return -1; 1483 return -1;
1484 } 1484 }
1485 [_computeHashCode](element) { 1485 [_computeHashCode](element) {
1486 return this[_hasher](dart.as(element, E)) & 0x3ffffff; 1486 return this[_hasher](dart.as(element, E)) & 0x3ffffff;
1487 } 1487 }
1488 add(element) { 1488 add(element) {
1489 return super._add(element); 1489 return super._add(element);
1490 } 1490 }
1491 contains(object) { 1491 contains(object) {
1492 if (!dart.notNull(this[_validKey](object))) 1492 if (!dart.notNull(this[_validKey](object)))
1493 return false; 1493 return false;
1494 return super._contains(object); 1494 return super._contains(object);
1495 } 1495 }
1496 lookup(object) { 1496 lookup(object) {
1497 if (!dart.notNull(this[_validKey](object))) 1497 if (!dart.notNull(this[_validKey](object)))
1498 return dart.as(null, E); 1498 return null;
1499 return super._lookup(object); 1499 return super._lookup(object);
1500 } 1500 }
1501 remove(object) { 1501 remove(object) {
1502 if (!dart.notNull(this[_validKey](object))) 1502 if (!dart.notNull(this[_validKey](object)))
1503 return false; 1503 return false;
1504 return super._remove(object); 1504 return super._remove(object);
1505 } 1505 }
1506 containsAll(elements) { 1506 containsAll(elements) {
1507 for (let element of elements) { 1507 for (let element of elements) {
1508 if (dart.notNull(!dart.notNull(this[_validKey](element))) || dart.notN ull(!dart.notNull(this.contains(element)))) 1508 if (!dart.notNull(this[_validKey](element)) || !dart.notNull(this.cont ains(element)))
1509 return false; 1509 return false;
1510 } 1510 }
1511 return true; 1511 return true;
1512 } 1512 }
1513 removeAll(elements) { 1513 removeAll(elements) {
1514 for (let element of elements) { 1514 for (let element of elements) {
1515 if (this[_validKey](element)) { 1515 if (this[_validKey](element)) {
1516 super._remove(element); 1516 super._remove(element);
1517 } 1517 }
1518 } 1518 }
1519 } 1519 }
1520 } 1520 }
1521 return _LinkedCustomHashSet; 1521 return _LinkedCustomHashSet;
1522 }); 1522 });
1523 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic); 1523 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic);
1524 class LinkedHashSetCell extends dart.Object { 1524 class LinkedHashSetCell extends dart.Object {
1525 LinkedHashSetCell($_element) { 1525 LinkedHashSetCell($_element) {
1526 this[_element] = $_element; 1526 this[_element] = $_element;
1527 this[_next] = null; 1527 this[_next] = null;
1528 this[_previous] = null; 1528 this[_previous] = null;
1529 } 1529 }
1530 } 1530 }
1531 let LinkedHashSetIterator$ = dart.generic(function(E) { 1531 let LinkedHashSetIterator$ = dart.generic(function(E) {
1532 class LinkedHashSetIterator extends dart.Object { 1532 class LinkedHashSetIterator extends dart.Object {
1533 LinkedHashSetIterator($_set, $_modifications) { 1533 LinkedHashSetIterator($_set, $_modifications) {
1534 this[_set] = $_set; 1534 this[_set] = $_set;
1535 this[_modifications] = $_modifications; 1535 this[_modifications] = $_modifications;
1536 this[_cell] = null; 1536 this[_cell] = null;
1537 this[_current] = dart.as(null, E); 1537 this[_current] = null;
1538 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel l); 1538 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel l);
1539 } 1539 }
1540 get current() { 1540 get current() {
1541 return this[_current]; 1541 return this[_current];
1542 } 1542 }
1543 moveNext() { 1543 moveNext() {
1544 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) { 1544 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) {
1545 throw new core.ConcurrentModificationError(this[_set]); 1545 throw new core.ConcurrentModificationError(this[_set]);
1546 } else if (this[_cell] === null) { 1546 } else if (this[_cell] === null) {
1547 this[_current] = dart.as(null, E); 1547 this[_current] = null;
1548 return false; 1548 return false;
1549 } else { 1549 } else {
1550 this[_current] = dart.as(this[_cell][_element], E); 1550 this[_current] = dart.as(this[_cell][_element], E);
1551 this[_cell] = this[_cell][_next]; 1551 this[_cell] = this[_cell][_next];
1552 return true; 1552 return true;
1553 } 1553 }
1554 } 1554 }
1555 } 1555 }
1556 return LinkedHashSetIterator; 1556 return LinkedHashSetIterator;
1557 }); 1557 });
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 return new core.List.from(this, {growable: growable}); 1792 return new core.List.from(this, {growable: growable});
1793 } 1793 }
1794 toSet() { 1794 toSet() {
1795 return new core.Set.from(this); 1795 return new core.Set.from(this);
1796 } 1796 }
1797 get length() { 1797 get length() {
1798 dart.assert(!dart.is(this, _internal.EfficientLength)); 1798 dart.assert(!dart.is(this, _internal.EfficientLength));
1799 let count = 0; 1799 let count = 0;
1800 let it = this.iterator; 1800 let it = this.iterator;
1801 while (it.moveNext()) { 1801 while (it.moveNext()) {
1802 count++; 1802 dart.notNull(count)++;
1803 } 1803 }
1804 return count; 1804 return count;
1805 } 1805 }
1806 get isEmpty() { 1806 get isEmpty() {
1807 return !dart.notNull(this.iterator.moveNext()); 1807 return !dart.notNull(this.iterator.moveNext());
1808 } 1808 }
1809 get isNotEmpty() { 1809 get isNotEmpty() {
1810 return !dart.notNull(this.isEmpty); 1810 return !dart.notNull(this.isEmpty);
1811 } 1811 }
1812 take(n) { 1812 take(n) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 for (let element of this) { 1853 for (let element of this) {
1854 if (test(element)) 1854 if (test(element))
1855 return element; 1855 return element;
1856 } 1856 }
1857 if (orElse !== null) 1857 if (orElse !== null)
1858 return orElse(); 1858 return orElse();
1859 throw _internal.IterableElementError.noElement(); 1859 throw _internal.IterableElementError.noElement();
1860 } 1860 }
1861 lastWhere(test, opt$) { 1861 lastWhere(test, opt$) {
1862 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 1862 let orElse = opt$.orElse === void 0 ? null : opt$.orElse;
1863 let result = dart.as(null, E); 1863 let result = null;
1864 let foundMatching = false; 1864 let foundMatching = false;
1865 for (let element of this) { 1865 for (let element of this) {
1866 if (test(element)) { 1866 if (test(element)) {
1867 result = element; 1867 result = element;
1868 foundMatching = true; 1868 foundMatching = true;
1869 } 1869 }
1870 } 1870 }
1871 if (foundMatching) 1871 if (foundMatching)
1872 return result; 1872 return result;
1873 if (orElse !== null) 1873 if (orElse !== null)
1874 return orElse(); 1874 return orElse();
1875 throw _internal.IterableElementError.noElement(); 1875 throw _internal.IterableElementError.noElement();
1876 } 1876 }
1877 singleWhere(test) { 1877 singleWhere(test) {
1878 let result = dart.as(null, E); 1878 let result = null;
1879 let foundMatching = false; 1879 let foundMatching = false;
1880 for (let element of this) { 1880 for (let element of this) {
1881 if (test(element)) { 1881 if (test(element)) {
1882 if (foundMatching) { 1882 if (foundMatching) {
1883 throw _internal.IterableElementError.tooMany(); 1883 throw _internal.IterableElementError.tooMany();
1884 } 1884 }
1885 result = element; 1885 result = element;
1886 foundMatching = true; 1886 foundMatching = true;
1887 } 1887 }
1888 } 1888 }
1889 if (foundMatching) 1889 if (foundMatching)
1890 return result; 1890 return result;
1891 throw _internal.IterableElementError.noElement(); 1891 throw _internal.IterableElementError.noElement();
1892 } 1892 }
1893 elementAt(index) { 1893 elementAt(index) {
1894 if (!(typeof index == number)) 1894 if (!(typeof index == number))
1895 throw new core.ArgumentError.notNull("index"); 1895 throw new core.ArgumentError.notNull("index");
1896 core.RangeError.checkNotNegative(index, "index"); 1896 core.RangeError.checkNotNegative(index, "index");
1897 let elementIndex = 0; 1897 let elementIndex = 0;
1898 for (let element of this) { 1898 for (let element of this) {
1899 if (index === elementIndex) 1899 if (index === elementIndex)
1900 return element; 1900 return element;
1901 elementIndex++; 1901 dart.notNull(elementIndex)++;
1902 } 1902 }
1903 throw new core.RangeError.index(index, this, "index", null, elementIndex ); 1903 throw new core.RangeError.index(index, this, "index", null, elementIndex );
1904 } 1904 }
1905 toString() { 1905 toString() {
1906 return IterableBase.iterableToShortString(this, '(', ')'); 1906 return IterableBase.iterableToShortString(this, '(', ')');
1907 } 1907 }
1908 } 1908 }
1909 return IterableMixin; 1909 return IterableMixin;
1910 }); 1910 });
1911 let IterableMixin = IterableMixin$(dynamic); 1911 let IterableMixin = IterableMixin$(dynamic);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 return new core.List.from(this, {growable: growable}); 1991 return new core.List.from(this, {growable: growable});
1992 } 1992 }
1993 toSet() { 1993 toSet() {
1994 return new core.Set.from(this); 1994 return new core.Set.from(this);
1995 } 1995 }
1996 get length() { 1996 get length() {
1997 dart.assert(!dart.is(this, _internal.EfficientLength)); 1997 dart.assert(!dart.is(this, _internal.EfficientLength));
1998 let count = 0; 1998 let count = 0;
1999 let it = this.iterator; 1999 let it = this.iterator;
2000 while (it.moveNext()) { 2000 while (it.moveNext()) {
2001 count++; 2001 dart.notNull(count)++;
2002 } 2002 }
2003 return count; 2003 return count;
2004 } 2004 }
2005 get isEmpty() { 2005 get isEmpty() {
2006 return !dart.notNull(this.iterator.moveNext()); 2006 return !dart.notNull(this.iterator.moveNext());
2007 } 2007 }
2008 get isNotEmpty() { 2008 get isNotEmpty() {
2009 return !dart.notNull(this.isEmpty); 2009 return !dart.notNull(this.isEmpty);
2010 } 2010 }
2011 take(n) { 2011 take(n) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 for (let element of this) { 2052 for (let element of this) {
2053 if (test(element)) 2053 if (test(element))
2054 return element; 2054 return element;
2055 } 2055 }
2056 if (orElse !== null) 2056 if (orElse !== null)
2057 return orElse(); 2057 return orElse();
2058 throw _internal.IterableElementError.noElement(); 2058 throw _internal.IterableElementError.noElement();
2059 } 2059 }
2060 lastWhere(test, opt$) { 2060 lastWhere(test, opt$) {
2061 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 2061 let orElse = opt$.orElse === void 0 ? null : opt$.orElse;
2062 let result = dart.as(null, E); 2062 let result = null;
2063 let foundMatching = false; 2063 let foundMatching = false;
2064 for (let element of this) { 2064 for (let element of this) {
2065 if (test(element)) { 2065 if (test(element)) {
2066 result = element; 2066 result = element;
2067 foundMatching = true; 2067 foundMatching = true;
2068 } 2068 }
2069 } 2069 }
2070 if (foundMatching) 2070 if (foundMatching)
2071 return result; 2071 return result;
2072 if (orElse !== null) 2072 if (orElse !== null)
2073 return orElse(); 2073 return orElse();
2074 throw _internal.IterableElementError.noElement(); 2074 throw _internal.IterableElementError.noElement();
2075 } 2075 }
2076 singleWhere(test) { 2076 singleWhere(test) {
2077 let result = dart.as(null, E); 2077 let result = null;
2078 let foundMatching = false; 2078 let foundMatching = false;
2079 for (let element of this) { 2079 for (let element of this) {
2080 if (test(element)) { 2080 if (test(element)) {
2081 if (foundMatching) { 2081 if (foundMatching) {
2082 throw _internal.IterableElementError.tooMany(); 2082 throw _internal.IterableElementError.tooMany();
2083 } 2083 }
2084 result = element; 2084 result = element;
2085 foundMatching = true; 2085 foundMatching = true;
2086 } 2086 }
2087 } 2087 }
2088 if (foundMatching) 2088 if (foundMatching)
2089 return result; 2089 return result;
2090 throw _internal.IterableElementError.noElement(); 2090 throw _internal.IterableElementError.noElement();
2091 } 2091 }
2092 elementAt(index) { 2092 elementAt(index) {
2093 if (!(typeof index == number)) 2093 if (!(typeof index == number))
2094 throw new core.ArgumentError.notNull("index"); 2094 throw new core.ArgumentError.notNull("index");
2095 core.RangeError.checkNotNegative(index, "index"); 2095 core.RangeError.checkNotNegative(index, "index");
2096 let elementIndex = 0; 2096 let elementIndex = 0;
2097 for (let element of this) { 2097 for (let element of this) {
2098 if (index === elementIndex) 2098 if (index === elementIndex)
2099 return element; 2099 return element;
2100 elementIndex++; 2100 dart.notNull(elementIndex)++;
2101 } 2101 }
2102 throw new core.RangeError.index(index, this, "index", null, elementIndex ); 2102 throw new core.RangeError.index(index, this, "index", null, elementIndex );
2103 } 2103 }
2104 toString() { 2104 toString() {
2105 return iterableToShortString(this, '(', ')'); 2105 return iterableToShortString(this, '(', ')');
2106 } 2106 }
2107 static iterableToShortString(iterable, leftDelimiter, rightDelimiter) { 2107 static iterableToShortString(iterable, leftDelimiter, rightDelimiter) {
2108 if (leftDelimiter === void 0) 2108 if (leftDelimiter === void 0)
2109 leftDelimiter = '('; 2109 leftDelimiter = '(';
2110 if (rightDelimiter === void 0) 2110 if (rightDelimiter === void 0)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 try { 2142 try {
2143 buffer.writeAll(iterable, ", "); 2143 buffer.writeAll(iterable, ", ");
2144 } finally { 2144 } finally {
2145 dart.assert(core.identical(_toStringVisiting.last, iterable)); 2145 dart.assert(core.identical(_toStringVisiting.last, iterable));
2146 _toStringVisiting.removeLast(); 2146 _toStringVisiting.removeLast();
2147 } 2147 }
2148 buffer.write(rightDelimiter); 2148 buffer.write(rightDelimiter);
2149 return buffer.toString(); 2149 return buffer.toString();
2150 } 2150 }
2151 static [_isToStringVisiting](o) { 2151 static [_isToStringVisiting](o) {
2152 for (let i = 0; i < _toStringVisiting.length; i++) { 2152 for (let i = 0; dart.notNull(i) < dart.notNull(_toStringVisiting.length) ; dart.notNull(i)++) {
2153 if (core.identical(o, _toStringVisiting.get(i))) 2153 if (core.identical(o, _toStringVisiting.get(i)))
2154 return true; 2154 return true;
2155 } 2155 }
2156 return false; 2156 return false;
2157 } 2157 }
2158 static [_iterablePartsToStrings](iterable, parts) { 2158 static [_iterablePartsToStrings](iterable, parts) {
2159 let LENGTH_LIMIT = 80; 2159 let LENGTH_LIMIT = 80;
2160 let HEAD_COUNT = 3; 2160 let HEAD_COUNT = 3;
2161 let TAIL_COUNT = 2; 2161 let TAIL_COUNT = 2;
2162 let MAX_COUNT = 100; 2162 let MAX_COUNT = 100;
2163 let OVERHEAD = 2; 2163 let OVERHEAD = 2;
2164 let ELLIPSIS_SIZE = 3; 2164 let ELLIPSIS_SIZE = 3;
2165 let length = 0; 2165 let length = 0;
2166 let count = 0; 2166 let count = 0;
2167 let it = iterable.iterator; 2167 let it = iterable.iterator;
2168 while (dart.notNull(length < LENGTH_LIMIT) || dart.notNull(count < HEAD_ COUNT)) { 2168 while (dart.notNull(length) < dart.notNull(LENGTH_LIMIT) || dart.notNull (count) < dart.notNull(HEAD_COUNT)) {
2169 if (!dart.notNull(it.moveNext())) 2169 if (!dart.notNull(it.moveNext()))
2170 return; 2170 return;
2171 let next = `${it.current}`; 2171 let next = `${it.current}`;
2172 parts.add(next); 2172 parts.add(next);
2173 length = next.length + OVERHEAD; 2173 length = dart.notNull(next.length) + dart.notNull(OVERHEAD);
2174 count++; 2174 dart.notNull(count)++;
2175 } 2175 }
2176 let penultimateString = null; 2176 let penultimateString = null;
2177 let ultimateString = null; 2177 let ultimateString = null;
2178 let penultimate = null; 2178 let penultimate = null;
2179 let ultimate = null; 2179 let ultimate = null;
2180 if (!dart.notNull(it.moveNext())) { 2180 if (!dart.notNull(it.moveNext())) {
2181 if (count <= HEAD_COUNT + TAIL_COUNT) 2181 if (dart.notNull(count) <= dart.notNull(HEAD_COUNT) + dart.notNull(TAI L_COUNT))
2182 return; 2182 return;
2183 ultimateString = dart.as(parts.removeLast(), core.String); 2183 ultimateString = dart.as(parts.removeLast(), core.String);
2184 penultimateString = dart.as(parts.removeLast(), core.String); 2184 penultimateString = dart.as(parts.removeLast(), core.String);
2185 } else { 2185 } else {
2186 penultimate = it.current; 2186 penultimate = it.current;
2187 count++; 2187 dart.notNull(count)++;
2188 if (!dart.notNull(it.moveNext())) { 2188 if (!dart.notNull(it.moveNext())) {
2189 if (count <= HEAD_COUNT + 1) { 2189 if (dart.notNull(count) <= dart.notNull(HEAD_COUNT) + 1) {
2190 parts.add(`${penultimate}`); 2190 parts.add(`${penultimate}`);
2191 return; 2191 return;
2192 } 2192 }
2193 ultimateString = `${penultimate}`; 2193 ultimateString = `${penultimate}`;
2194 penultimateString = dart.as(parts.removeLast(), core.String); 2194 penultimateString = dart.as(parts.removeLast(), core.String);
2195 length = ultimateString.length + OVERHEAD; 2195 length = dart.notNull(ultimateString.length) + dart.notNull(OVERHEAD );
2196 } else { 2196 } else {
2197 ultimate = it.current; 2197 ultimate = it.current;
2198 count++; 2198 dart.notNull(count)++;
2199 dart.assert(count < MAX_COUNT); 2199 dart.assert(dart.notNull(count) < dart.notNull(MAX_COUNT));
2200 while (it.moveNext()) { 2200 while (it.moveNext()) {
2201 penultimate = ultimate; 2201 penultimate = ultimate;
2202 ultimate = it.current; 2202 ultimate = it.current;
2203 count++; 2203 dart.notNull(count)++;
2204 if (count > MAX_COUNT) { 2204 if (dart.notNull(count) > dart.notNull(MAX_COUNT)) {
2205 while (dart.notNull(length > LENGTH_LIMIT - ELLIPSIS_SIZE - OVER HEAD) && dart.notNull(count > HEAD_COUNT)) { 2205 while (dart.notNull(length) > dart.notNull(LENGTH_LIMIT) - dart. notNull(ELLIPSIS_SIZE) - dart.notNull(OVERHEAD) && dart.notNull(count) > dart.no tNull(HEAD_COUNT)) {
2206 length = dart.as(dart.dbinary(dart.dload(parts.removeLast(), ' length'), '+', OVERHEAD), core.int); 2206 length = dart.as(dart.dbinary(dart.dload(parts.removeLast(), ' length'), '+', OVERHEAD), core.int);
2207 count--; 2207 dart.notNull(count)--;
2208 } 2208 }
2209 parts.add("..."); 2209 parts.add("...");
2210 return; 2210 return;
2211 } 2211 }
2212 } 2212 }
2213 penultimateString = `${penultimate}`; 2213 penultimateString = `${penultimate}`;
2214 ultimateString = `${ultimate}`; 2214 ultimateString = `${ultimate}`;
2215 length = ultimateString.length + penultimateString.length + 2 * OVER HEAD; 2215 length = dart.notNull(ultimateString.length) + dart.notNull(penultim ateString.length) + 2 * dart.notNull(OVERHEAD);
2216 } 2216 }
2217 } 2217 }
2218 let elision = null; 2218 let elision = null;
2219 if (count > parts.length + TAIL_COUNT) { 2219 if (dart.notNull(count) > dart.notNull(parts.length) + dart.notNull(TAIL _COUNT)) {
2220 elision = "..."; 2220 elision = "...";
2221 length = ELLIPSIS_SIZE + OVERHEAD; 2221 length = dart.notNull(ELLIPSIS_SIZE) + dart.notNull(OVERHEAD);
2222 } 2222 }
2223 while (dart.notNull(length > LENGTH_LIMIT) && dart.notNull(parts.length > HEAD_COUNT)) { 2223 while (dart.notNull(length) > dart.notNull(LENGTH_LIMIT) && dart.notNull (parts.length) > dart.notNull(HEAD_COUNT)) {
2224 length = dart.as(dart.dbinary(dart.dload(parts.removeLast(), 'length') , '+', OVERHEAD), core.int); 2224 length = dart.as(dart.dbinary(dart.dload(parts.removeLast(), 'length') , '+', OVERHEAD), core.int);
2225 if (elision === null) { 2225 if (elision === null) {
2226 elision = "..."; 2226 elision = "...";
2227 length = ELLIPSIS_SIZE + OVERHEAD; 2227 length = dart.notNull(ELLIPSIS_SIZE) + dart.notNull(OVERHEAD);
2228 } 2228 }
2229 } 2229 }
2230 if (elision !== null) { 2230 if (elision !== null) {
2231 parts.add(elision); 2231 parts.add(elision);
2232 } 2232 }
2233 parts.add(penultimateString); 2233 parts.add(penultimateString);
2234 parts.add(ultimateString); 2234 parts.add(ultimateString);
2235 } 2235 }
2236 } 2236 }
2237 dart.defineLazyProperties(IterableBase, { 2237 dart.defineLazyProperties(IterableBase, {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 this[_unlink](entry); 2421 this[_unlink](entry);
2422 return true; 2422 return true;
2423 } 2423 }
2424 get iterator() { 2424 get iterator() {
2425 return new _LinkedListIterator(this); 2425 return new _LinkedListIterator(this);
2426 } 2426 }
2427 get length() { 2427 get length() {
2428 return this[_length]; 2428 return this[_length];
2429 } 2429 }
2430 clear() { 2430 clear() {
2431 this[_modificationCount]++; 2431 dart.notNull(this[_modificationCount])++;
2432 let next = this[_next]; 2432 let next = this[_next];
2433 while (!dart.notNull(core.identical(next, this))) { 2433 while (!dart.notNull(core.identical(next, this))) {
2434 let entry = dart.as(next, E); 2434 let entry = dart.as(next, E);
2435 next = entry[_next]; 2435 next = entry[_next];
2436 entry[_next] = entry[_previous] = entry[_list] = null; 2436 entry[_next] = entry[_previous] = entry[_list] = null;
2437 } 2437 }
2438 this[_next] = this[_previous] = this; 2438 this[_next] = this[_previous] = this;
2439 this[_length] = 0; 2439 this[_length] = 0;
2440 } 2440 }
2441 get first() { 2441 get first() {
(...skipping 28 matching lines...) Expand all
2470 current = current[_next]; 2470 current = current[_next];
2471 } 2471 }
2472 } 2472 }
2473 get isEmpty() { 2473 get isEmpty() {
2474 return this[_length] === 0; 2474 return this[_length] === 0;
2475 } 2475 }
2476 [_insertAfter](entry, newEntry) { 2476 [_insertAfter](entry, newEntry) {
2477 if (newEntry.list !== null) { 2477 if (newEntry.list !== null) {
2478 throw new core.StateError('LinkedListEntry is already in a LinkedList' ); 2478 throw new core.StateError('LinkedListEntry is already in a LinkedList' );
2479 } 2479 }
2480 this[_modificationCount]++; 2480 dart.notNull(this[_modificationCount])++;
2481 newEntry[_list] = this; 2481 newEntry[_list] = this;
2482 let predecessor = entry; 2482 let predecessor = entry;
2483 let successor = entry[_next]; 2483 let successor = entry[_next];
2484 successor[_previous] = newEntry; 2484 successor[_previous] = newEntry;
2485 newEntry[_previous] = predecessor; 2485 newEntry[_previous] = predecessor;
2486 newEntry[_next] = successor; 2486 newEntry[_next] = successor;
2487 predecessor[_next] = newEntry; 2487 predecessor[_next] = newEntry;
2488 this[_length]++; 2488 dart.notNull(this[_length])++;
2489 } 2489 }
2490 [_unlink](entry) { 2490 [_unlink](entry) {
2491 this[_modificationCount]++; 2491 dart.notNull(this[_modificationCount])++;
2492 entry[_next][_previous] = entry[_previous]; 2492 entry[_next][_previous] = entry[_previous];
2493 entry[_previous][_next] = entry[_next]; 2493 entry[_previous][_next] = entry[_next];
2494 this[_length]--; 2494 dart.notNull(this[_length])--;
2495 entry[_list] = entry[_next] = entry[_previous] = null; 2495 entry[_list] = entry[_next] = entry[_previous] = null;
2496 } 2496 }
2497 } 2497 }
2498 return LinkedList; 2498 return LinkedList;
2499 }); 2499 });
2500 let LinkedList = LinkedList$(dynamic); 2500 let LinkedList = LinkedList$(dynamic);
2501 let _LinkedListIterator$ = dart.generic(function(E) { 2501 let _LinkedListIterator$ = dart.generic(function(E) {
2502 class _LinkedListIterator extends dart.Object { 2502 class _LinkedListIterator extends dart.Object {
2503 _LinkedListIterator(list) { 2503 _LinkedListIterator(list) {
2504 this[_list] = list; 2504 this[_list] = list;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 let ListMixin$ = dart.generic(function(E) { 2578 let ListMixin$ = dart.generic(function(E) {
2579 class ListMixin extends dart.Object { 2579 class ListMixin extends dart.Object {
2580 get iterator() { 2580 get iterator() {
2581 return new _internal.ListIterator(this); 2581 return new _internal.ListIterator(this);
2582 } 2582 }
2583 elementAt(index) { 2583 elementAt(index) {
2584 return this.get(index); 2584 return this.get(index);
2585 } 2585 }
2586 forEach(action) { 2586 forEach(action) {
2587 let length = this.length; 2587 let length = this.length;
2588 for (let i = 0; i < length; i++) { 2588 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2589 action(this.get(i)); 2589 action(this.get(i));
2590 if (length !== this.length) { 2590 if (length !== this.length) {
2591 throw new core.ConcurrentModificationError(this); 2591 throw new core.ConcurrentModificationError(this);
2592 } 2592 }
2593 } 2593 }
2594 } 2594 }
2595 get isEmpty() { 2595 get isEmpty() {
2596 return this.length === 0; 2596 return this.length === 0;
2597 } 2597 }
2598 get isNotEmpty() { 2598 get isNotEmpty() {
2599 return !dart.notNull(this.isEmpty); 2599 return !dart.notNull(this.isEmpty);
2600 } 2600 }
2601 get first() { 2601 get first() {
2602 if (this.length === 0) 2602 if (this.length === 0)
2603 throw _internal.IterableElementError.noElement(); 2603 throw _internal.IterableElementError.noElement();
2604 return this.get(0); 2604 return this.get(0);
2605 } 2605 }
2606 get last() { 2606 get last() {
2607 if (this.length === 0) 2607 if (this.length === 0)
2608 throw _internal.IterableElementError.noElement(); 2608 throw _internal.IterableElementError.noElement();
2609 return this.get(this.length - 1); 2609 return this.get(dart.notNull(this.length) - 1);
2610 } 2610 }
2611 get single() { 2611 get single() {
2612 if (this.length === 0) 2612 if (this.length === 0)
2613 throw _internal.IterableElementError.noElement(); 2613 throw _internal.IterableElementError.noElement();
2614 if (this.length > 1) 2614 if (dart.notNull(this.length) > 1)
2615 throw _internal.IterableElementError.tooMany(); 2615 throw _internal.IterableElementError.tooMany();
2616 return this.get(0); 2616 return this.get(0);
2617 } 2617 }
2618 contains(element) { 2618 contains(element) {
2619 let length = this.length; 2619 let length = this.length;
2620 for (let i = 0; i < this.length; i++) { 2620 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); dart.notNul l(i)++) {
2621 if (dart.equals(this.get(i), element)) 2621 if (dart.equals(this.get(i), element))
2622 return true; 2622 return true;
2623 if (length !== this.length) { 2623 if (length !== this.length) {
2624 throw new core.ConcurrentModificationError(this); 2624 throw new core.ConcurrentModificationError(this);
2625 } 2625 }
2626 } 2626 }
2627 return false; 2627 return false;
2628 } 2628 }
2629 every(test) { 2629 every(test) {
2630 let length = this.length; 2630 let length = this.length;
2631 for (let i = 0; i < length; i++) { 2631 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2632 if (!dart.notNull(test(this.get(i)))) 2632 if (!dart.notNull(test(this.get(i))))
2633 return false; 2633 return false;
2634 if (length !== this.length) { 2634 if (length !== this.length) {
2635 throw new core.ConcurrentModificationError(this); 2635 throw new core.ConcurrentModificationError(this);
2636 } 2636 }
2637 } 2637 }
2638 return true; 2638 return true;
2639 } 2639 }
2640 any(test) { 2640 any(test) {
2641 let length = this.length; 2641 let length = this.length;
2642 for (let i = 0; i < length; i++) { 2642 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2643 if (test(this.get(i))) 2643 if (test(this.get(i)))
2644 return true; 2644 return true;
2645 if (length !== this.length) { 2645 if (length !== this.length) {
2646 throw new core.ConcurrentModificationError(this); 2646 throw new core.ConcurrentModificationError(this);
2647 } 2647 }
2648 } 2648 }
2649 return false; 2649 return false;
2650 } 2650 }
2651 firstWhere(test, opt$) { 2651 firstWhere(test, opt$) {
2652 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 2652 let orElse = opt$.orElse === void 0 ? null : opt$.orElse;
2653 let length = this.length; 2653 let length = this.length;
2654 for (let i = 0; i < length; i++) { 2654 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2655 let element = this.get(i); 2655 let element = this.get(i);
2656 if (test(element)) 2656 if (test(element))
2657 return element; 2657 return element;
2658 if (length !== this.length) { 2658 if (length !== this.length) {
2659 throw new core.ConcurrentModificationError(this); 2659 throw new core.ConcurrentModificationError(this);
2660 } 2660 }
2661 } 2661 }
2662 if (orElse !== null) 2662 if (orElse !== null)
2663 return orElse(); 2663 return orElse();
2664 throw _internal.IterableElementError.noElement(); 2664 throw _internal.IterableElementError.noElement();
2665 } 2665 }
2666 lastWhere(test, opt$) { 2666 lastWhere(test, opt$) {
2667 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 2667 let orElse = opt$.orElse === void 0 ? null : opt$.orElse;
2668 let length = this.length; 2668 let length = this.length;
2669 for (let i = length - 1; i >= 0; i--) { 2669 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; dart.notNul l(i)--) {
2670 let element = this.get(i); 2670 let element = this.get(i);
2671 if (test(element)) 2671 if (test(element))
2672 return element; 2672 return element;
2673 if (length !== this.length) { 2673 if (length !== this.length) {
2674 throw new core.ConcurrentModificationError(this); 2674 throw new core.ConcurrentModificationError(this);
2675 } 2675 }
2676 } 2676 }
2677 if (orElse !== null) 2677 if (orElse !== null)
2678 return orElse(); 2678 return orElse();
2679 throw _internal.IterableElementError.noElement(); 2679 throw _internal.IterableElementError.noElement();
2680 } 2680 }
2681 singleWhere(test) { 2681 singleWhere(test) {
2682 let length = this.length; 2682 let length = this.length;
2683 let match = dart.as(null, E); 2683 let match = null;
2684 let matchFound = false; 2684 let matchFound = false;
2685 for (let i = 0; i < length; i++) { 2685 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2686 let element = this.get(i); 2686 let element = this.get(i);
2687 if (test(element)) { 2687 if (test(element)) {
2688 if (matchFound) { 2688 if (matchFound) {
2689 throw _internal.IterableElementError.tooMany(); 2689 throw _internal.IterableElementError.tooMany();
2690 } 2690 }
2691 matchFound = true; 2691 matchFound = true;
2692 match = element; 2692 match = element;
2693 } 2693 }
2694 if (length !== this.length) { 2694 if (length !== this.length) {
2695 throw new core.ConcurrentModificationError(this); 2695 throw new core.ConcurrentModificationError(this);
(...skipping 19 matching lines...) Expand all
2715 return new _internal.MappedListIterable(this, dart.as(f, dart.throw_("Un implemented type (dynamic) → dynamic"))); 2715 return new _internal.MappedListIterable(this, dart.as(f, dart.throw_("Un implemented type (dynamic) → dynamic")));
2716 } 2716 }
2717 expand(f) { 2717 expand(f) {
2718 return new _internal.ExpandIterable(this, f); 2718 return new _internal.ExpandIterable(this, f);
2719 } 2719 }
2720 reduce(combine) { 2720 reduce(combine) {
2721 let length = this.length; 2721 let length = this.length;
2722 if (length === 0) 2722 if (length === 0)
2723 throw _internal.IterableElementError.noElement(); 2723 throw _internal.IterableElementError.noElement();
2724 let value = this.get(0); 2724 let value = this.get(0);
2725 for (let i = 1; i < length; i++) { 2725 for (let i = 1; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2726 value = combine(value, this.get(i)); 2726 value = combine(value, this.get(i));
2727 if (length !== this.length) { 2727 if (length !== this.length) {
2728 throw new core.ConcurrentModificationError(this); 2728 throw new core.ConcurrentModificationError(this);
2729 } 2729 }
2730 } 2730 }
2731 return value; 2731 return value;
2732 } 2732 }
2733 fold(initialValue, combine) { 2733 fold(initialValue, combine) {
2734 let value = initialValue; 2734 let value = initialValue;
2735 let length = this.length; 2735 let length = this.length;
2736 for (let i = 0; i < length; i++) { 2736 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2737 value = combine(value, this.get(i)); 2737 value = combine(value, this.get(i));
2738 if (length !== this.length) { 2738 if (length !== this.length) {
2739 throw new core.ConcurrentModificationError(this); 2739 throw new core.ConcurrentModificationError(this);
2740 } 2740 }
2741 } 2741 }
2742 return value; 2742 return value;
2743 } 2743 }
2744 skip(count) { 2744 skip(count) {
2745 return new _internal.SubListIterable(this, count, dart.as(null, core.int )); 2745 return new _internal.SubListIterable(this, count, null);
2746 } 2746 }
2747 skipWhile(test) { 2747 skipWhile(test) {
2748 return new _internal.SkipWhileIterable(this, test); 2748 return new _internal.SkipWhileIterable(this, test);
2749 } 2749 }
2750 take(count) { 2750 take(count) {
2751 return new _internal.SubListIterable(this, 0, count); 2751 return new _internal.SubListIterable(this, 0, count);
2752 } 2752 }
2753 takeWhile(test) { 2753 takeWhile(test) {
2754 return new _internal.TakeWhileIterable(this, test); 2754 return new _internal.TakeWhileIterable(this, test);
2755 } 2755 }
2756 toList(opt$) { 2756 toList(opt$) {
2757 let growable = opt$.growable === void 0 ? true : opt$.growable; 2757 let growable = opt$.growable === void 0 ? true : opt$.growable;
2758 let result = null; 2758 let result = null;
2759 if (growable) { 2759 if (growable) {
2760 result = ((_) => { 2760 result = ((_) => {
2761 _.length = this.length; 2761 _.length = this.length;
2762 return _; 2762 return _;
2763 }).bind(this)(new core.List()); 2763 }).bind(this)(new core.List());
2764 } else { 2764 } else {
2765 result = new core.List(this.length); 2765 result = new core.List(this.length);
2766 } 2766 }
2767 for (let i = 0; i < this.length; i++) { 2767 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); dart.notNul l(i)++) {
2768 result.set(i, this.get(i)); 2768 result.set(i, this.get(i));
2769 } 2769 }
2770 return result; 2770 return result;
2771 } 2771 }
2772 toSet() { 2772 toSet() {
2773 let result = new core.Set(); 2773 let result = new core.Set();
2774 for (let i = 0; i < this.length; i++) { 2774 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); dart.notNul l(i)++) {
2775 result.add(this.get(i)); 2775 result.add(this.get(i));
2776 } 2776 }
2777 return result; 2777 return result;
2778 } 2778 }
2779 add(element) { 2779 add(element) {
2780 this.set(this.length++, element); 2780 this.set(dart.notNull(this.length)++, element);
2781 } 2781 }
2782 addAll(iterable) { 2782 addAll(iterable) {
2783 for (let element of iterable) { 2783 for (let element of iterable) {
2784 this.set(this.length++, element); 2784 this.set(dart.notNull(this.length)++, element);
2785 } 2785 }
2786 } 2786 }
2787 remove(element) { 2787 remove(element) {
2788 for (let i = 0; i < this.length; i++) { 2788 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); dart.notNul l(i)++) {
2789 if (dart.equals(this.get(i), element)) { 2789 if (dart.equals(this.get(i), element)) {
2790 this.setRange(i, this.length - 1, this, i + 1); 2790 this.setRange(i, dart.notNull(this.length) - 1, this, dart.notNull(i ) + 1);
2791 this.length = 1; 2791 this.length = 1;
2792 return true; 2792 return true;
2793 } 2793 }
2794 } 2794 }
2795 return false; 2795 return false;
2796 } 2796 }
2797 removeWhere(test) { 2797 removeWhere(test) {
2798 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) → bool")), false); 2798 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) → bool")), false);
2799 } 2799 }
2800 retainWhere(test) { 2800 retainWhere(test) {
2801 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) → bool")), true); 2801 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) → bool")), true);
2802 } 2802 }
2803 static [_filter](source, test, retainMatching) { 2803 static [_filter](source, test, retainMatching) {
2804 let retained = new List.from([]); 2804 let retained = new List.from([]);
2805 let length = source.length; 2805 let length = source.length;
2806 for (let i = 0; i < length; i++) { 2806 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2807 let element = source.get(i); 2807 let element = source.get(i);
2808 if (test(element) === retainMatching) { 2808 if (test(element) === retainMatching) {
2809 retained.add(element); 2809 retained.add(element);
2810 } 2810 }
2811 if (length !== source.length) { 2811 if (length !== source.length) {
2812 throw new core.ConcurrentModificationError(source); 2812 throw new core.ConcurrentModificationError(source);
2813 } 2813 }
2814 } 2814 }
2815 if (retained.length !== source.length) { 2815 if (retained.length !== source.length) {
2816 source.setRange(0, retained.length, retained); 2816 source.setRange(0, retained.length, retained);
2817 source.length = retained.length; 2817 source.length = retained.length;
2818 } 2818 }
2819 } 2819 }
2820 clear() { 2820 clear() {
2821 this.length = 0; 2821 this.length = 0;
2822 } 2822 }
2823 removeLast() { 2823 removeLast() {
2824 if (this.length === 0) { 2824 if (this.length === 0) {
2825 throw _internal.IterableElementError.noElement(); 2825 throw _internal.IterableElementError.noElement();
2826 } 2826 }
2827 let result = this.get(this.length - 1); 2827 let result = this.get(dart.notNull(this.length) - 1);
2828 this.length--; 2828 dart.notNull(this.length)--;
2829 return result; 2829 return result;
2830 } 2830 }
2831 sort(compare) { 2831 sort(compare) {
2832 if (compare === void 0) 2832 if (compare === void 0)
2833 compare = null; 2833 compare = null;
2834 if (compare === null) { 2834 if (compare === null) {
2835 let defaultCompare = core.Comparable.compare; 2835 let defaultCompare = core.Comparable.compare;
2836 compare = defaultCompare; 2836 compare = defaultCompare;
2837 } 2837 }
2838 _internal.Sort.sort(this, dart.as(compare, dart.throw_("Unimplemented ty pe (dynamic, dynamic) → int"))); 2838 _internal.Sort.sort(this, dart.as(compare, dart.throw_("Unimplemented ty pe (dynamic, dynamic) → int")));
2839 } 2839 }
2840 shuffle(random) { 2840 shuffle(random) {
2841 if (random === void 0) 2841 if (random === void 0)
2842 random = null; 2842 random = null;
2843 if (random === null) 2843 if (random === null)
2844 random = new math.Random(); 2844 random = new math.Random();
2845 let length = this.length; 2845 let length = this.length;
2846 while (length > 1) { 2846 while (dart.notNull(length) > 1) {
2847 let pos = random.nextInt(length); 2847 let pos = random.nextInt(length);
2848 length = 1; 2848 length = 1;
2849 let tmp = this.get(length); 2849 let tmp = this.get(length);
2850 this.set(length, this.get(pos)); 2850 this.set(length, this.get(pos));
2851 this.set(pos, tmp); 2851 this.set(pos, tmp);
2852 } 2852 }
2853 } 2853 }
2854 asMap() { 2854 asMap() {
2855 return new _internal.ListMapView(this); 2855 return new _internal.ListMapView(this);
2856 } 2856 }
2857 sublist(start, end) { 2857 sublist(start, end) {
2858 if (end === void 0) 2858 if (end === void 0)
2859 end = null; 2859 end = null;
2860 let listLength = this.length; 2860 let listLength = this.length;
2861 if (end === null) 2861 if (end === null)
2862 end = listLength; 2862 end = listLength;
2863 core.RangeError.checkValidRange(start, end, listLength); 2863 core.RangeError.checkValidRange(start, end, listLength);
2864 let length = end - start; 2864 let length = dart.notNull(end) - dart.notNull(start);
2865 let result = new core.List(); 2865 let result = new core.List();
2866 result.length = length; 2866 result.length = length;
2867 for (let i = 0; i < length; i++) { 2867 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i)+ +) {
2868 result.set(i, this.get(start + i)); 2868 result.set(i, this.get(dart.notNull(start) + dart.notNull(i)));
2869 } 2869 }
2870 return result; 2870 return result;
2871 } 2871 }
2872 getRange(start, end) { 2872 getRange(start, end) {
2873 core.RangeError.checkValidRange(start, end, this.length); 2873 core.RangeError.checkValidRange(start, end, this.length);
2874 return new _internal.SubListIterable(this, start, end); 2874 return new _internal.SubListIterable(this, start, end);
2875 } 2875 }
2876 removeRange(start, end) { 2876 removeRange(start, end) {
2877 core.RangeError.checkValidRange(start, end, this.length); 2877 core.RangeError.checkValidRange(start, end, this.length);
2878 let length = end - start; 2878 let length = dart.notNull(end) - dart.notNull(start);
2879 this.setRange(start, this.length - length, this, end); 2879 this.setRange(start, dart.notNull(this.length) - dart.notNull(length), t his, end);
2880 this.length = length; 2880 this.length = length;
2881 } 2881 }
2882 fillRange(start, end, fill) { 2882 fillRange(start, end, fill) {
2883 if (fill === void 0) 2883 if (fill === void 0)
2884 fill = null; 2884 fill = null;
2885 core.RangeError.checkValidRange(start, end, this.length); 2885 core.RangeError.checkValidRange(start, end, this.length);
2886 for (let i = start; i < end; i++) { 2886 for (let i = start; dart.notNull(i) < dart.notNull(end); dart.notNull(i) ++) {
2887 this.set(i, fill); 2887 this.set(i, fill);
2888 } 2888 }
2889 } 2889 }
2890 setRange(start, end, iterable, skipCount) { 2890 setRange(start, end, iterable, skipCount) {
2891 if (skipCount === void 0) 2891 if (skipCount === void 0)
2892 skipCount = 0; 2892 skipCount = 0;
2893 core.RangeError.checkValidRange(start, end, this.length); 2893 core.RangeError.checkValidRange(start, end, this.length);
2894 let length = end - start; 2894 let length = dart.notNull(end) - dart.notNull(start);
2895 if (length === 0) 2895 if (length === 0)
2896 return; 2896 return;
2897 core.RangeError.checkNotNegative(skipCount, "skipCount"); 2897 core.RangeError.checkNotNegative(skipCount, "skipCount");
2898 let otherList = null; 2898 let otherList = null;
2899 let otherStart = null; 2899 let otherStart = null;
2900 if (dart.is(iterable, core.List)) { 2900 if (dart.is(iterable, core.List)) {
2901 otherList = dart.as(iterable, core.List); 2901 otherList = dart.as(iterable, core.List);
2902 otherStart = skipCount; 2902 otherStart = skipCount;
2903 } else { 2903 } else {
2904 otherList = iterable.skip(skipCount).toList({growable: false}); 2904 otherList = iterable.skip(skipCount).toList({growable: false});
2905 otherStart = 0; 2905 otherStart = 0;
2906 } 2906 }
2907 if (otherStart + length > otherList.length) { 2907 if (dart.notNull(otherStart) + dart.notNull(length) > dart.notNull(other List.length)) {
2908 throw _internal.IterableElementError.tooFew(); 2908 throw _internal.IterableElementError.tooFew();
2909 } 2909 }
2910 if (otherStart < start) { 2910 if (dart.notNull(otherStart) < dart.notNull(start)) {
2911 for (let i = length - 1; i >= 0; i--) { 2911 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; dart.notN ull(i)--) {
2912 this.set(start + i, dart.as(otherList.get(otherStart + i), E)); 2912 this.set(dart.notNull(start) + dart.notNull(i), dart.as(otherList.ge t(dart.notNull(otherStart) + dart.notNull(i)), E));
2913 } 2913 }
2914 } else { 2914 } else {
2915 for (let i = 0; i < length; i++) { 2915 for (let i = 0; dart.notNull(i) < dart.notNull(length); dart.notNull(i )++) {
2916 this.set(start + i, dart.as(otherList.get(otherStart + i), E)); 2916 this.set(dart.notNull(start) + dart.notNull(i), dart.as(otherList.ge t(dart.notNull(otherStart) + dart.notNull(i)), E));
2917 } 2917 }
2918 } 2918 }
2919 } 2919 }
2920 replaceRange(start, end, newContents) { 2920 replaceRange(start, end, newContents) {
2921 core.RangeError.checkValidRange(start, end, this.length); 2921 core.RangeError.checkValidRange(start, end, this.length);
2922 if (!dart.is(newContents, _internal.EfficientLength)) { 2922 if (!dart.is(newContents, _internal.EfficientLength)) {
2923 newContents = newContents.toList(); 2923 newContents = newContents.toList();
2924 } 2924 }
2925 let removeLength = end - start; 2925 let removeLength = dart.notNull(end) - dart.notNull(start);
2926 let insertLength = newContents.length; 2926 let insertLength = newContents.length;
2927 if (removeLength >= insertLength) { 2927 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) {
2928 let delta = removeLength - insertLength; 2928 let delta = dart.notNull(removeLength) - dart.notNull(insertLength);
2929 let insertEnd = start + insertLength; 2929 let insertEnd = dart.notNull(start) + dart.notNull(insertLength);
2930 let newLength = this.length - delta; 2930 let newLength = dart.notNull(this.length) - dart.notNull(delta);
2931 this.setRange(start, insertEnd, newContents); 2931 this.setRange(start, insertEnd, newContents);
2932 if (delta !== 0) { 2932 if (delta !== 0) {
2933 this.setRange(insertEnd, newLength, this, end); 2933 this.setRange(insertEnd, newLength, this, end);
2934 this.length = newLength; 2934 this.length = newLength;
2935 } 2935 }
2936 } else { 2936 } else {
2937 let delta = insertLength - removeLength; 2937 let delta = dart.notNull(insertLength) - dart.notNull(removeLength);
2938 let newLength = this.length + delta; 2938 let newLength = dart.notNull(this.length) + dart.notNull(delta);
2939 let insertEnd = start + insertLength; 2939 let insertEnd = dart.notNull(start) + dart.notNull(insertLength);
2940 this.length = newLength; 2940 this.length = newLength;
2941 this.setRange(insertEnd, newLength, this, end); 2941 this.setRange(insertEnd, newLength, this, end);
2942 this.setRange(start, insertEnd, newContents); 2942 this.setRange(start, insertEnd, newContents);
2943 } 2943 }
2944 } 2944 }
2945 indexOf(element, startIndex) { 2945 indexOf(element, startIndex) {
2946 if (startIndex === void 0) 2946 if (startIndex === void 0)
2947 startIndex = 0; 2947 startIndex = 0;
2948 if (startIndex >= this.length) { 2948 if (dart.notNull(startIndex) >= dart.notNull(this.length)) {
2949 return -1; 2949 return -1;
2950 } 2950 }
2951 if (startIndex < 0) { 2951 if (dart.notNull(startIndex) < 0) {
2952 startIndex = 0; 2952 startIndex = 0;
2953 } 2953 }
2954 for (let i = startIndex; i < this.length; i++) { 2954 for (let i = startIndex; dart.notNull(i) < dart.notNull(this.length); da rt.notNull(i)++) {
2955 if (dart.equals(this.get(i), element)) { 2955 if (dart.equals(this.get(i), element)) {
2956 return i; 2956 return i;
2957 } 2957 }
2958 } 2958 }
2959 return -1; 2959 return -1;
2960 } 2960 }
2961 lastIndexOf(element, startIndex) { 2961 lastIndexOf(element, startIndex) {
2962 if (startIndex === void 0) 2962 if (startIndex === void 0)
2963 startIndex = null; 2963 startIndex = null;
2964 if (startIndex === null) { 2964 if (startIndex === null) {
2965 startIndex = this.length - 1; 2965 startIndex = dart.notNull(this.length) - 1;
2966 } else { 2966 } else {
2967 if (startIndex < 0) { 2967 if (dart.notNull(startIndex) < 0) {
2968 return -1; 2968 return -1;
2969 } 2969 }
2970 if (startIndex >= this.length) { 2970 if (dart.notNull(startIndex) >= dart.notNull(this.length)) {
2971 startIndex = this.length - 1; 2971 startIndex = dart.notNull(this.length) - 1;
2972 } 2972 }
2973 } 2973 }
2974 for (let i = startIndex; i >= 0; i--) { 2974 for (let i = startIndex; dart.notNull(i) >= 0; dart.notNull(i)--) {
2975 if (dart.equals(this.get(i), element)) { 2975 if (dart.equals(this.get(i), element)) {
2976 return i; 2976 return i;
2977 } 2977 }
2978 } 2978 }
2979 return -1; 2979 return -1;
2980 } 2980 }
2981 insert(index, element) { 2981 insert(index, element) {
2982 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); 2982 core.RangeError.checkValueInInterval(index, 0, this.length, "index");
2983 if (index === this.length) { 2983 if (index === this.length) {
2984 this.add(element); 2984 this.add(element);
2985 return; 2985 return;
2986 } 2986 }
2987 if (!(typeof index == number)) 2987 if (!(typeof index == number))
2988 throw new core.ArgumentError(index); 2988 throw new core.ArgumentError(index);
2989 this.length++; 2989 dart.notNull(this.length)++;
2990 this.setRange(index + 1, this.length, this, index); 2990 this.setRange(dart.notNull(index) + 1, this.length, this, index);
2991 this.set(index, element); 2991 this.set(index, element);
2992 } 2992 }
2993 removeAt(index) { 2993 removeAt(index) {
2994 let result = this.get(index); 2994 let result = this.get(index);
2995 this.setRange(index, this.length - 1, this, index + 1); 2995 this.setRange(index, dart.notNull(this.length) - 1, this, dart.notNull(i ndex) + 1);
2996 this.length--; 2996 dart.notNull(this.length)--;
2997 return result; 2997 return result;
2998 } 2998 }
2999 insertAll(index, iterable) { 2999 insertAll(index, iterable) {
3000 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); 3000 core.RangeError.checkValueInInterval(index, 0, this.length, "index");
3001 if (dart.is(iterable, _internal.EfficientLength)) { 3001 if (dart.is(iterable, _internal.EfficientLength)) {
3002 iterable = iterable.toList(); 3002 iterable = iterable.toList();
3003 } 3003 }
3004 let insertionLength = iterable.length; 3004 let insertionLength = iterable.length;
3005 this.length = insertionLength; 3005 this.length = insertionLength;
3006 this.setRange(index + insertionLength, this.length, this, index); 3006 this.setRange(dart.notNull(index) + dart.notNull(insertionLength), this. length, this, index);
3007 this.setAll(index, iterable); 3007 this.setAll(index, iterable);
3008 } 3008 }
3009 setAll(index, iterable) { 3009 setAll(index, iterable) {
3010 if (dart.is(iterable, core.List)) { 3010 if (dart.is(iterable, core.List)) {
3011 this.setRange(index, index + iterable.length, iterable); 3011 this.setRange(index, dart.notNull(index) + dart.notNull(iterable.lengt h), iterable);
3012 } else { 3012 } else {
3013 for (let element of iterable) { 3013 for (let element of iterable) {
3014 this.set(index++, element); 3014 this.set(dart.notNull(index)++, element);
3015 } 3015 }
3016 } 3016 }
3017 } 3017 }
3018 get reversed() { 3018 get reversed() {
3019 return new _internal.ReversedListIterable(this); 3019 return new _internal.ReversedListIterable(this);
3020 } 3020 }
3021 toString() { 3021 toString() {
3022 return IterableBase.iterableToFullString(this, '[', ']'); 3022 return IterableBase.iterableToFullString(this, '[', ']');
3023 } 3023 }
3024 } 3024 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
3113 } 3113 }
3114 } 3114 }
3115 return _MapBaseValueIterable; 3115 return _MapBaseValueIterable;
3116 }); 3116 });
3117 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic); 3117 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic);
3118 let _MapBaseValueIterator$ = dart.generic(function(V) { 3118 let _MapBaseValueIterator$ = dart.generic(function(V) {
3119 class _MapBaseValueIterator extends dart.Object { 3119 class _MapBaseValueIterator extends dart.Object {
3120 _MapBaseValueIterator(map) { 3120 _MapBaseValueIterator(map) {
3121 this[_map] = map; 3121 this[_map] = map;
3122 this[_keys] = map.keys.iterator; 3122 this[_keys] = map.keys.iterator;
3123 this[_current] = dart.as(null, V); 3123 this[_current] = null;
3124 } 3124 }
3125 moveNext() { 3125 moveNext() {
3126 if (this[_keys].moveNext()) { 3126 if (this[_keys].moveNext()) {
3127 this[_current] = dart.as(this[_map].get(this[_keys].current), V); 3127 this[_current] = dart.as(this[_map].get(this[_keys].current), V);
3128 return true; 3128 return true;
3129 } 3129 }
3130 this[_current] = dart.as(null, V); 3130 this[_current] = null;
3131 return false; 3131 return false;
3132 } 3132 }
3133 get current() { 3133 get current() {
3134 return this[_current]; 3134 return this[_current];
3135 } 3135 }
3136 } 3136 }
3137 return _MapBaseValueIterator; 3137 return _MapBaseValueIterator;
3138 }); 3138 });
3139 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic); 3139 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic);
3140 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { 3140 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
3377 set element(e) { 3377 set element(e) {
3378 this[_element] = e; 3378 this[_element] = e;
3379 } 3379 }
3380 } 3380 }
3381 return DoubleLinkedQueueEntry; 3381 return DoubleLinkedQueueEntry;
3382 }); 3382 });
3383 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic); 3383 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic);
3384 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { 3384 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) {
3385 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { 3385 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) {
3386 _DoubleLinkedQueueEntrySentinel() { 3386 _DoubleLinkedQueueEntrySentinel() {
3387 super.DoubleLinkedQueueEntry(dart.as(null, E)); 3387 super.DoubleLinkedQueueEntry(null);
3388 this[_link](this, this); 3388 this[_link](this, this);
3389 } 3389 }
3390 remove() { 3390 remove() {
3391 throw _internal.IterableElementError.noElement(); 3391 throw _internal.IterableElementError.noElement();
3392 } 3392 }
3393 [_asNonSentinelEntry]() { 3393 [_asNonSentinelEntry]() {
3394 return null; 3394 return null;
3395 } 3395 }
3396 set element(e) { 3396 set element(e) {
3397 dart.assert(false); 3397 dart.assert(false);
(...skipping 20 matching lines...) Expand all
3418 for (let e of elements) { 3418 for (let e of elements) {
3419 list.addLast(e); 3419 list.addLast(e);
3420 } 3420 }
3421 return dart.as(list, DoubleLinkedQueue$(E)); 3421 return dart.as(list, DoubleLinkedQueue$(E));
3422 } 3422 }
3423 get length() { 3423 get length() {
3424 return this[_elementCount]; 3424 return this[_elementCount];
3425 } 3425 }
3426 addLast(value) { 3426 addLast(value) {
3427 this[_sentinel].prepend(value); 3427 this[_sentinel].prepend(value);
3428 this[_elementCount]++; 3428 dart.notNull(this[_elementCount])++;
3429 } 3429 }
3430 addFirst(value) { 3430 addFirst(value) {
3431 this[_sentinel].append(value); 3431 this[_sentinel].append(value);
3432 this[_elementCount]++; 3432 dart.notNull(this[_elementCount])++;
3433 } 3433 }
3434 add(value) { 3434 add(value) {
3435 this[_sentinel].prepend(value); 3435 this[_sentinel].prepend(value);
3436 this[_elementCount]++; 3436 dart.notNull(this[_elementCount])++;
3437 } 3437 }
3438 addAll(iterable) { 3438 addAll(iterable) {
3439 for (let value of iterable) { 3439 for (let value of iterable) {
3440 this[_sentinel].prepend(value); 3440 this[_sentinel].prepend(value);
3441 this[_elementCount]++; 3441 dart.notNull(this[_elementCount])++;
3442 } 3442 }
3443 } 3443 }
3444 removeLast() { 3444 removeLast() {
3445 let result = this[_sentinel][_previous].remove(); 3445 let result = this[_sentinel][_previous].remove();
3446 this[_elementCount]--; 3446 dart.notNull(this[_elementCount])--;
3447 return result; 3447 return result;
3448 } 3448 }
3449 removeFirst() { 3449 removeFirst() {
3450 let result = this[_sentinel][_next].remove(); 3450 let result = this[_sentinel][_next].remove();
3451 this[_elementCount]--; 3451 dart.notNull(this[_elementCount])--;
3452 return result; 3452 return result;
3453 } 3453 }
3454 remove(o) { 3454 remove(o) {
3455 let entry = this[_sentinel][_next]; 3455 let entry = this[_sentinel][_next];
3456 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { 3456 while (!dart.notNull(core.identical(entry, this[_sentinel]))) {
3457 if (dart.equals(entry.element, o)) { 3457 if (dart.equals(entry.element, o)) {
3458 entry.remove(); 3458 entry.remove();
3459 this[_elementCount]--; 3459 dart.notNull(this[_elementCount])--;
3460 return true; 3460 return true;
3461 } 3461 }
3462 entry = entry[_next]; 3462 entry = entry[_next];
3463 } 3463 }
3464 return false; 3464 return false;
3465 } 3465 }
3466 [_filter](test, removeMatching) { 3466 [_filter](test, removeMatching) {
3467 let entry = this[_sentinel][_next]; 3467 let entry = this[_sentinel][_next];
3468 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { 3468 while (!dart.notNull(core.identical(entry, this[_sentinel]))) {
3469 let next = entry[_next]; 3469 let next = entry[_next];
3470 if (core.identical(removeMatching, test(entry.element))) { 3470 if (core.identical(removeMatching, test(entry.element))) {
3471 entry.remove(); 3471 entry.remove();
3472 this[_elementCount]--; 3472 dart.notNull(this[_elementCount])--;
3473 } 3473 }
3474 entry = next; 3474 entry = next;
3475 } 3475 }
3476 } 3476 }
3477 removeWhere(test) { 3477 removeWhere(test) {
3478 this[_filter](test, true); 3478 this[_filter](test, true);
3479 } 3479 }
3480 retainWhere(test) { 3480 retainWhere(test) {
3481 this[_filter](test, false); 3481 this[_filter](test, false);
3482 } 3482 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
3524 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); 3524 dart.defineNamedConstructor(DoubleLinkedQueue, 'from');
3525 return DoubleLinkedQueue; 3525 return DoubleLinkedQueue;
3526 }); 3526 });
3527 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic); 3527 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic);
3528 let _nextEntry = Symbol('_nextEntry'); 3528 let _nextEntry = Symbol('_nextEntry');
3529 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { 3529 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) {
3530 class _DoubleLinkedQueueIterator extends dart.Object { 3530 class _DoubleLinkedQueueIterator extends dart.Object {
3531 _DoubleLinkedQueueIterator(sentinel) { 3531 _DoubleLinkedQueueIterator(sentinel) {
3532 this[_sentinel] = sentinel; 3532 this[_sentinel] = sentinel;
3533 this[_nextEntry] = sentinel[_next]; 3533 this[_nextEntry] = sentinel[_next];
3534 this[_current] = dart.as(null, E); 3534 this[_current] = null;
3535 } 3535 }
3536 moveNext() { 3536 moveNext() {
3537 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) { 3537 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) {
3538 this[_current] = this[_nextEntry][_element]; 3538 this[_current] = this[_nextEntry][_element];
3539 this[_nextEntry] = this[_nextEntry][_next]; 3539 this[_nextEntry] = this[_nextEntry][_next];
3540 return true; 3540 return true;
3541 } 3541 }
3542 this[_current] = dart.as(null, E); 3542 this[_current] = null;
3543 this[_nextEntry] = this[_sentinel] = null; 3543 this[_nextEntry] = this[_sentinel] = null;
3544 return false; 3544 return false;
3545 } 3545 }
3546 get current() { 3546 get current() {
3547 return this[_current]; 3547 return this[_current];
3548 } 3548 }
3549 } 3549 }
3550 return _DoubleLinkedQueueIterator; 3550 return _DoubleLinkedQueueIterator;
3551 }); 3551 });
3552 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic); 3552 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic);
3553 let _head = Symbol('_head'); 3553 let _head = Symbol('_head');
3554 let _tail = Symbol('_tail'); 3554 let _tail = Symbol('_tail');
3555 let _table = Symbol('_table'); 3555 let _table = Symbol('_table');
3556 let _checkModification = Symbol('_checkModification'); 3556 let _checkModification = Symbol('_checkModification');
3557 let _writeToList = Symbol('_writeToList'); 3557 let _writeToList = Symbol('_writeToList');
3558 let _preGrow = Symbol('_preGrow'); 3558 let _preGrow = Symbol('_preGrow');
3559 let _grow = Symbol('_grow'); 3559 let _grow = Symbol('_grow');
3560 let _isPowerOf2 = Symbol('_isPowerOf2'); 3560 let _isPowerOf2 = Symbol('_isPowerOf2');
3561 let _nextPowerOf2 = Symbol('_nextPowerOf2'); 3561 let _nextPowerOf2 = Symbol('_nextPowerOf2');
3562 let ListQueue$ = dart.generic(function(E) { 3562 let ListQueue$ = dart.generic(function(E) {
3563 class ListQueue extends IterableBase$(E) { 3563 class ListQueue extends IterableBase$(E) {
3564 ListQueue(initialCapacity) { 3564 ListQueue(initialCapacity) {
3565 if (initialCapacity === void 0) 3565 if (initialCapacity === void 0)
3566 initialCapacity = null; 3566 initialCapacity = null;
3567 this[_head] = 0; 3567 this[_head] = 0;
3568 this[_tail] = 0; 3568 this[_tail] = 0;
3569 this[_table] = null; 3569 this[_table] = null;
3570 this[_modificationCount] = 0; 3570 this[_modificationCount] = 0;
3571 super.IterableBase(); 3571 super.IterableBase();
3572 if (dart.notNull(initialCapacity === null) || dart.notNull(initialCapaci ty < _INITIAL_CAPACITY)) { 3572 if (initialCapacity === null || dart.notNull(initialCapacity) < dart.not Null(_INITIAL_CAPACITY)) {
3573 initialCapacity = _INITIAL_CAPACITY; 3573 initialCapacity = _INITIAL_CAPACITY;
3574 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { 3574 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) {
3575 initialCapacity = _nextPowerOf2(initialCapacity); 3575 initialCapacity = _nextPowerOf2(initialCapacity);
3576 } 3576 }
3577 dart.assert(_isPowerOf2(initialCapacity)); 3577 dart.assert(_isPowerOf2(initialCapacity));
3578 this[_table] = new core.List(initialCapacity); 3578 this[_table] = new core.List(initialCapacity);
3579 } 3579 }
3580 ListQueue$from(elements) { 3580 ListQueue$from(elements) {
3581 if (dart.is(elements, core.List)) { 3581 if (dart.is(elements, core.List)) {
3582 let length = elements.length; 3582 let length = elements.length;
3583 let queue = dart.as(new ListQueue(length + 1), ListQueue$(E)); 3583 let queue = dart.as(new ListQueue(dart.notNull(length) + 1), ListQueue $(E));
3584 dart.assert(queue[_table].length > length); 3584 dart.assert(dart.notNull(queue[_table].length) > dart.notNull(length)) ;
3585 let sourceList = elements; 3585 let sourceList = elements;
3586 queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E )), 0); 3586 queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E )), 0);
3587 queue[_tail] = length; 3587 queue[_tail] = length;
3588 return queue; 3588 return queue;
3589 } else { 3589 } else {
3590 let capacity = _INITIAL_CAPACITY; 3590 let capacity = _INITIAL_CAPACITY;
3591 if (dart.is(elements, _internal.EfficientLength)) { 3591 if (dart.is(elements, _internal.EfficientLength)) {
3592 capacity = elements.length; 3592 capacity = elements.length;
3593 } 3593 }
3594 let result = new ListQueue(capacity); 3594 let result = new ListQueue(capacity);
3595 for (let element of elements) { 3595 for (let element of elements) {
3596 result.addLast(element); 3596 result.addLast(element);
3597 } 3597 }
3598 return result; 3598 return result;
3599 } 3599 }
3600 } 3600 }
3601 get iterator() { 3601 get iterator() {
3602 return new _ListQueueIterator(this); 3602 return new _ListQueueIterator(this);
3603 } 3603 }
3604 forEach(action) { 3604 forEach(action) {
3605 let modificationCount = this[_modificationCount]; 3605 let modificationCount = this[_modificationCount];
3606 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].le ngth - 1) { 3606 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d art.notNull(this[_table].length) - 1) {
3607 action(this[_table].get(i)); 3607 action(this[_table].get(i));
3608 this[_checkModification](modificationCount); 3608 this[_checkModification](modificationCount);
3609 } 3609 }
3610 } 3610 }
3611 get isEmpty() { 3611 get isEmpty() {
3612 return this[_head] === this[_tail]; 3612 return this[_head] === this[_tail];
3613 } 3613 }
3614 get length() { 3614 get length() {
3615 return this[_tail] - this[_head] & this[_table].length - 1; 3615 return dart.notNull(this[_tail]) - dart.notNull(this[_head]) & dart.notN ull(this[_table].length) - 1;
3616 } 3616 }
3617 get first() { 3617 get first() {
3618 if (this[_head] === this[_tail]) 3618 if (this[_head] === this[_tail])
3619 throw _internal.IterableElementError.noElement(); 3619 throw _internal.IterableElementError.noElement();
3620 return this[_table].get(this[_head]); 3620 return this[_table].get(this[_head]);
3621 } 3621 }
3622 get last() { 3622 get last() {
3623 if (this[_head] === this[_tail]) 3623 if (this[_head] === this[_tail])
3624 throw _internal.IterableElementError.noElement(); 3624 throw _internal.IterableElementError.noElement();
3625 return this[_table].get(this[_tail] - 1 & this[_table].length - 1); 3625 return this[_table].get(dart.notNull(this[_tail]) - 1 & dart.notNull(thi s[_table].length) - 1);
3626 } 3626 }
3627 get single() { 3627 get single() {
3628 if (this[_head] === this[_tail]) 3628 if (this[_head] === this[_tail])
3629 throw _internal.IterableElementError.noElement(); 3629 throw _internal.IterableElementError.noElement();
3630 if (this.length > 1) 3630 if (dart.notNull(this.length) > 1)
3631 throw _internal.IterableElementError.tooMany(); 3631 throw _internal.IterableElementError.tooMany();
3632 return this[_table].get(this[_head]); 3632 return this[_table].get(this[_head]);
3633 } 3633 }
3634 elementAt(index) { 3634 elementAt(index) {
3635 core.RangeError.checkValidIndex(index, this); 3635 core.RangeError.checkValidIndex(index, this);
3636 return this[_table].get(this[_head] + index & this[_table].length - 1); 3636 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table].length) - 1);
3637 } 3637 }
3638 toList(opt$) { 3638 toList(opt$) {
3639 let growable = opt$.growable === void 0 ? true : opt$.growable; 3639 let growable = opt$.growable === void 0 ? true : opt$.growable;
3640 let list = null; 3640 let list = null;
3641 if (growable) { 3641 if (growable) {
3642 list = ((_) => { 3642 list = ((_) => {
3643 _.length = this.length; 3643 _.length = this.length;
3644 return _; 3644 return _;
3645 }).bind(this)(new core.List()); 3645 }).bind(this)(new core.List());
3646 } else { 3646 } else {
3647 list = new core.List(this.length); 3647 list = new core.List(this.length);
3648 } 3648 }
3649 this[_writeToList](list); 3649 this[_writeToList](list);
3650 return list; 3650 return list;
3651 } 3651 }
3652 add(element) { 3652 add(element) {
3653 this[_add](element); 3653 this[_add](element);
3654 } 3654 }
3655 addAll(elements) { 3655 addAll(elements) {
3656 if (dart.is(elements, core.List)) { 3656 if (dart.is(elements, core.List)) {
3657 let list = dart.as(elements, core.List); 3657 let list = dart.as(elements, core.List);
3658 let addCount = list.length; 3658 let addCount = list.length;
3659 let length = this.length; 3659 let length = this.length;
3660 if (length + addCount >= this[_table].length) { 3660 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this [_table].length)) {
3661 this[_preGrow](length + addCount); 3661 this[_preGrow](dart.notNull(length) + dart.notNull(addCount));
3662 this[_table].setRange(length, length + addCount, dart.as(list, core. Iterable$(E)), 0); 3662 this[_table].setRange(length, dart.notNull(length) + dart.notNull(ad dCount), dart.as(list, core.Iterable$(E)), 0);
3663 this[_tail] = addCount; 3663 this[_tail] = addCount;
3664 } else { 3664 } else {
3665 let endSpace = this[_table].length - this[_tail]; 3665 let endSpace = dart.notNull(this[_table].length) - dart.notNull(this [_tail]);
3666 if (addCount < endSpace) { 3666 if (dart.notNull(addCount) < dart.notNull(endSpace)) {
3667 this[_table].setRange(this[_tail], this[_tail] + addCount, dart.as (list, core.Iterable$(E)), 0); 3667 this[_table].setRange(this[_tail], dart.notNull(this[_tail]) + dar t.notNull(addCount), dart.as(list, core.Iterable$(E)), 0);
3668 this[_tail] = addCount; 3668 this[_tail] = addCount;
3669 } else { 3669 } else {
3670 let preSpace = addCount - endSpace; 3670 let preSpace = dart.notNull(addCount) - dart.notNull(endSpace);
3671 this[_table].setRange(this[_tail], this[_tail] + endSpace, dart.as (list, core.Iterable$(E)), 0); 3671 this[_table].setRange(this[_tail], dart.notNull(this[_tail]) + dar t.notNull(endSpace), dart.as(list, core.Iterable$(E)), 0);
3672 this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E) ), endSpace); 3672 this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E) ), endSpace);
3673 this[_tail] = preSpace; 3673 this[_tail] = preSpace;
3674 } 3674 }
3675 } 3675 }
3676 this[_modificationCount]++; 3676 dart.notNull(this[_modificationCount])++;
3677 } else { 3677 } else {
3678 for (let element of elements) 3678 for (let element of elements)
3679 this[_add](element); 3679 this[_add](element);
3680 } 3680 }
3681 } 3681 }
3682 remove(object) { 3682 remove(object) {
3683 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].le ngth - 1) { 3683 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d art.notNull(this[_table].length) - 1) {
3684 let element = this[_table].get(i); 3684 let element = this[_table].get(i);
3685 if (dart.equals(element, object)) { 3685 if (dart.equals(element, object)) {
3686 this[_remove](i); 3686 this[_remove](i);
3687 this[_modificationCount]++; 3687 dart.notNull(this[_modificationCount])++;
3688 return true; 3688 return true;
3689 } 3689 }
3690 } 3690 }
3691 return false; 3691 return false;
3692 } 3692 }
3693 [_filterWhere](test, removeMatching) { 3693 [_filterWhere](test, removeMatching) {
3694 let index = this[_head]; 3694 let index = this[_head];
3695 let modificationCount = this[_modificationCount]; 3695 let modificationCount = this[_modificationCount];
3696 let i = this[_head]; 3696 let i = this[_head];
3697 while (i !== this[_tail]) { 3697 while (i !== this[_tail]) {
3698 let element = this[_table].get(i); 3698 let element = this[_table].get(i);
3699 let remove = core.identical(removeMatching, test(element)); 3699 let remove = core.identical(removeMatching, test(element));
3700 this[_checkModification](modificationCount); 3700 this[_checkModification](modificationCount);
3701 if (remove) { 3701 if (remove) {
3702 i = this[_remove](i); 3702 i = this[_remove](i);
3703 modificationCount = ++this[_modificationCount]; 3703 modificationCount = ++dart.notNull(this[_modificationCount]);
3704 } else { 3704 } else {
3705 i = i + 1 & this[_table].length - 1; 3705 i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1;
3706 } 3706 }
3707 } 3707 }
3708 } 3708 }
3709 removeWhere(test) { 3709 removeWhere(test) {
3710 this[_filterWhere](test, true); 3710 this[_filterWhere](test, true);
3711 } 3711 }
3712 retainWhere(test) { 3712 retainWhere(test) {
3713 this[_filterWhere](test, false); 3713 this[_filterWhere](test, false);
3714 } 3714 }
3715 clear() { 3715 clear() {
3716 if (this[_head] !== this[_tail]) { 3716 if (this[_head] !== this[_tail]) {
3717 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table]. length - 1) { 3717 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1) {
3718 this[_table].set(i, dart.as(null, E)); 3718 this[_table].set(i, null);
3719 } 3719 }
3720 this[_head] = this[_tail] = 0; 3720 this[_head] = this[_tail] = 0;
3721 this[_modificationCount]++; 3721 dart.notNull(this[_modificationCount])++;
3722 } 3722 }
3723 } 3723 }
3724 toString() { 3724 toString() {
3725 return IterableBase.iterableToFullString(this, "{", "}"); 3725 return IterableBase.iterableToFullString(this, "{", "}");
3726 } 3726 }
3727 addLast(element) { 3727 addLast(element) {
3728 this[_add](element); 3728 this[_add](element);
3729 } 3729 }
3730 addFirst(element) { 3730 addFirst(element) {
3731 this[_head] = this[_head] - 1 & this[_table].length - 1; 3731 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table]. length) - 1;
3732 this[_table].set(this[_head], element); 3732 this[_table].set(this[_head], element);
3733 if (this[_head] === this[_tail]) 3733 if (this[_head] === this[_tail])
3734 this[_grow](); 3734 this[_grow]();
3735 this[_modificationCount]++; 3735 dart.notNull(this[_modificationCount])++;
3736 } 3736 }
3737 removeFirst() { 3737 removeFirst() {
3738 if (this[_head] === this[_tail]) 3738 if (this[_head] === this[_tail])
3739 throw _internal.IterableElementError.noElement(); 3739 throw _internal.IterableElementError.noElement();
3740 this[_modificationCount]++; 3740 dart.notNull(this[_modificationCount])++;
3741 let result = this[_table].get(this[_head]); 3741 let result = this[_table].get(this[_head]);
3742 this[_table].set(this[_head], dart.as(null, E)); 3742 this[_table].set(this[_head], null);
3743 this[_head] = this[_head] + 1 & this[_table].length - 1; 3743 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(this[_table]. length) - 1;
3744 return result; 3744 return result;
3745 } 3745 }
3746 removeLast() { 3746 removeLast() {
3747 if (this[_head] === this[_tail]) 3747 if (this[_head] === this[_tail])
3748 throw _internal.IterableElementError.noElement(); 3748 throw _internal.IterableElementError.noElement();
3749 this[_modificationCount]++; 3749 dart.notNull(this[_modificationCount])++;
3750 this[_tail] = this[_tail] - 1 & this[_table].length - 1; 3750 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table]. length) - 1;
3751 let result = this[_table].get(this[_tail]); 3751 let result = this[_table].get(this[_tail]);
3752 this[_table].set(this[_tail], dart.as(null, E)); 3752 this[_table].set(this[_tail], null);
3753 return result; 3753 return result;
3754 } 3754 }
3755 static [_isPowerOf2](number) { 3755 static [_isPowerOf2](number) {
3756 return (number & number - 1) === 0; 3756 return (dart.notNull(number) & dart.notNull(number) - 1) === 0;
3757 } 3757 }
3758 static [_nextPowerOf2](number) { 3758 static [_nextPowerOf2](number) {
3759 dart.assert(number > 0); 3759 dart.assert(dart.notNull(number) > 0);
3760 number = (number << 1) - 1; 3760 number = (dart.notNull(number) << 1) - 1;
3761 for (;;) { 3761 for (;;) {
3762 let nextNumber = number & number - 1; 3762 let nextNumber = dart.notNull(number) & dart.notNull(number) - 1;
3763 if (nextNumber === 0) 3763 if (nextNumber === 0)
3764 return number; 3764 return number;
3765 number = nextNumber; 3765 number = nextNumber;
3766 } 3766 }
3767 } 3767 }
3768 [_checkModification](expectedModificationCount) { 3768 [_checkModification](expectedModificationCount) {
3769 if (expectedModificationCount !== this[_modificationCount]) { 3769 if (expectedModificationCount !== this[_modificationCount]) {
3770 throw new core.ConcurrentModificationError(this); 3770 throw new core.ConcurrentModificationError(this);
3771 } 3771 }
3772 } 3772 }
3773 [_add](element) { 3773 [_add](element) {
3774 this[_table].set(this[_tail], element); 3774 this[_table].set(this[_tail], element);
3775 this[_tail] = this[_tail] + 1 & this[_table].length - 1; 3775 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table]. length) - 1;
3776 if (this[_head] === this[_tail]) 3776 if (this[_head] === this[_tail])
3777 this[_grow](); 3777 this[_grow]();
3778 this[_modificationCount]++; 3778 dart.notNull(this[_modificationCount])++;
3779 } 3779 }
3780 [_remove](offset) { 3780 [_remove](offset) {
3781 let mask = this[_table].length - 1; 3781 let mask = dart.notNull(this[_table].length) - 1;
3782 let startDistance = offset - this[_head] & mask; 3782 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d art.notNull(mask);
3783 let endDistance = this[_tail] - offset & mask; 3783 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar t.notNull(mask);
3784 if (startDistance < endDistance) { 3784 if (dart.notNull(startDistance) < dart.notNull(endDistance)) {
3785 let i = offset; 3785 let i = offset;
3786 while (i !== this[_head]) { 3786 while (i !== this[_head]) {
3787 let prevOffset = i - 1 & mask; 3787 let prevOffset = dart.notNull(i) - 1 & dart.notNull(mask);
3788 this[_table].set(i, this[_table].get(prevOffset)); 3788 this[_table].set(i, this[_table].get(prevOffset));
3789 i = prevOffset; 3789 i = prevOffset;
3790 } 3790 }
3791 this[_table].set(this[_head], dart.as(null, E)); 3791 this[_table].set(this[_head], null);
3792 this[_head] = this[_head] + 1 & mask; 3792 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(mask);
3793 return offset + 1 & mask; 3793 return dart.notNull(offset) + 1 & dart.notNull(mask);
3794 } else { 3794 } else {
3795 this[_tail] = this[_tail] - 1 & mask; 3795 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(mask);
3796 let i = offset; 3796 let i = offset;
3797 while (i !== this[_tail]) { 3797 while (i !== this[_tail]) {
3798 let nextOffset = i + 1 & mask; 3798 let nextOffset = dart.notNull(i) + 1 & dart.notNull(mask);
3799 this[_table].set(i, this[_table].get(nextOffset)); 3799 this[_table].set(i, this[_table].get(nextOffset));
3800 i = nextOffset; 3800 i = nextOffset;
3801 } 3801 }
3802 this[_table].set(this[_tail], dart.as(null, E)); 3802 this[_table].set(this[_tail], null);
3803 return offset; 3803 return offset;
3804 } 3804 }
3805 } 3805 }
3806 [_grow]() { 3806 [_grow]() {
3807 let newTable = new core.List(this[_table].length * 2); 3807 let newTable = new core.List(dart.notNull(this[_table].length) * 2);
3808 let split = this[_table].length - this[_head]; 3808 let split = dart.notNull(this[_table].length) - dart.notNull(this[_head] );
3809 newTable.setRange(0, split, this[_table], this[_head]); 3809 newTable.setRange(0, split, this[_table], this[_head]);
3810 newTable.setRange(split, split + this[_head], this[_table], 0); 3810 newTable.setRange(split, dart.notNull(split) + dart.notNull(this[_head]) , this[_table], 0);
3811 this[_head] = 0; 3811 this[_head] = 0;
3812 this[_tail] = this[_table].length; 3812 this[_tail] = this[_table].length;
3813 this[_table] = newTable; 3813 this[_table] = newTable;
3814 } 3814 }
3815 [_writeToList](target) { 3815 [_writeToList](target) {
3816 dart.assert(target.length >= this.length); 3816 dart.assert(dart.notNull(target.length) >= dart.notNull(this.length));
3817 if (this[_head] <= this[_tail]) { 3817 if (dart.notNull(this[_head]) <= dart.notNull(this[_tail])) {
3818 let length = this[_tail] - this[_head]; 3818 let length = dart.notNull(this[_tail]) - dart.notNull(this[_head]);
3819 target.setRange(0, length, this[_table], this[_head]); 3819 target.setRange(0, length, this[_table], this[_head]);
3820 return length; 3820 return length;
3821 } else { 3821 } else {
3822 let firstPartSize = this[_table].length - this[_head]; 3822 let firstPartSize = dart.notNull(this[_table].length) - dart.notNull(t his[_head]);
3823 target.setRange(0, firstPartSize, this[_table], this[_head]); 3823 target.setRange(0, firstPartSize, this[_table], this[_head]);
3824 target.setRange(firstPartSize, firstPartSize + this[_tail], this[_tabl e], 0); 3824 target.setRange(firstPartSize, dart.notNull(firstPartSize) + dart.notN ull(this[_tail]), this[_table], 0);
3825 return this[_tail] + firstPartSize; 3825 return dart.notNull(this[_tail]) + dart.notNull(firstPartSize);
3826 } 3826 }
3827 } 3827 }
3828 [_preGrow](newElementCount) { 3828 [_preGrow](newElementCount) {
3829 dart.assert(newElementCount >= this.length); 3829 dart.assert(dart.notNull(newElementCount) >= dart.notNull(this.length));
3830 newElementCount = newElementCount >> 1; 3830 newElementCount = dart.notNull(newElementCount) >> 1;
3831 let newCapacity = _nextPowerOf2(newElementCount); 3831 let newCapacity = _nextPowerOf2(newElementCount);
3832 let newTable = new core.List(newCapacity); 3832 let newTable = new core.List(newCapacity);
3833 this[_tail] = this[_writeToList](newTable); 3833 this[_tail] = this[_writeToList](newTable);
3834 this[_table] = newTable; 3834 this[_table] = newTable;
3835 this[_head] = 0; 3835 this[_head] = 0;
3836 } 3836 }
3837 } 3837 }
3838 dart.defineNamedConstructor(ListQueue, 'from'); 3838 dart.defineNamedConstructor(ListQueue, 'from');
3839 ListQueue._INITIAL_CAPACITY = 8; 3839 ListQueue._INITIAL_CAPACITY = 8;
3840 return ListQueue; 3840 return ListQueue;
3841 }); 3841 });
3842 let ListQueue = ListQueue$(dynamic); 3842 let ListQueue = ListQueue$(dynamic);
3843 let _queue = Symbol('_queue'); 3843 let _queue = Symbol('_queue');
3844 let _end = Symbol('_end'); 3844 let _end = Symbol('_end');
3845 let _position = Symbol('_position'); 3845 let _position = Symbol('_position');
3846 let _ListQueueIterator$ = dart.generic(function(E) { 3846 let _ListQueueIterator$ = dart.generic(function(E) {
3847 class _ListQueueIterator extends dart.Object { 3847 class _ListQueueIterator extends dart.Object {
3848 _ListQueueIterator(queue) { 3848 _ListQueueIterator(queue) {
3849 this[_queue] = queue; 3849 this[_queue] = queue;
3850 this[_end] = queue[_tail]; 3850 this[_end] = queue[_tail];
3851 this[_modificationCount] = queue[_modificationCount]; 3851 this[_modificationCount] = queue[_modificationCount];
3852 this[_position] = queue[_head]; 3852 this[_position] = queue[_head];
3853 this[_current] = dart.as(null, E); 3853 this[_current] = null;
3854 } 3854 }
3855 get current() { 3855 get current() {
3856 return this[_current]; 3856 return this[_current];
3857 } 3857 }
3858 moveNext() { 3858 moveNext() {
3859 this[_queue]._checkModification(this[_modificationCount]); 3859 this[_queue]._checkModification(this[_modificationCount]);
3860 if (this[_position] === this[_end]) { 3860 if (this[_position] === this[_end]) {
3861 this[_current] = dart.as(null, E); 3861 this[_current] = null;
3862 return false; 3862 return false;
3863 } 3863 }
3864 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); 3864 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E);
3865 this[_position] = this[_position] + 1 & this[_queue][_table].length - 1; 3865 this[_position] = dart.notNull(this[_position]) + 1 & dart.notNull(this[ _queue][_table].length) - 1;
3866 return true; 3866 return true;
3867 } 3867 }
3868 } 3868 }
3869 return _ListQueueIterator; 3869 return _ListQueueIterator;
3870 }); 3870 });
3871 let _ListQueueIterator = _ListQueueIterator$(dynamic); 3871 let _ListQueueIterator = _ListQueueIterator$(dynamic);
3872 let SetMixin$ = dart.generic(function(E) { 3872 let SetMixin$ = dart.generic(function(E) {
3873 class SetMixin extends dart.Object { 3873 class SetMixin extends dart.Object {
3874 get isEmpty() { 3874 get isEmpty() {
3875 return this.length === 0; 3875 return this.length === 0;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
3941 return result; 3941 return result;
3942 } 3942 }
3943 toList(opt$) { 3943 toList(opt$) {
3944 let growable = opt$.growable === void 0 ? true : opt$.growable; 3944 let growable = opt$.growable === void 0 ? true : opt$.growable;
3945 let result = growable ? ((_) => { 3945 let result = growable ? ((_) => {
3946 _.length = this.length; 3946 _.length = this.length;
3947 return _; 3947 return _;
3948 }).bind(this)(new core.List()) : new core.List(this.length); 3948 }).bind(this)(new core.List()) : new core.List(this.length);
3949 let i = 0; 3949 let i = 0;
3950 for (let element of this) 3950 for (let element of this)
3951 result.set(i++, element); 3951 result.set(dart.notNull(i)++, element);
3952 return result; 3952 return result;
3953 } 3953 }
3954 map(f) { 3954 map(f) {
3955 return new _internal.EfficientLengthMappedIterable(this, f); 3955 return new _internal.EfficientLengthMappedIterable(this, f);
3956 } 3956 }
3957 get single() { 3957 get single() {
3958 if (this.length > 1) 3958 if (dart.notNull(this.length) > 1)
3959 throw _internal.IterableElementError.tooMany(); 3959 throw _internal.IterableElementError.tooMany();
3960 let it = this.iterator; 3960 let it = this.iterator;
3961 if (!dart.notNull(it.moveNext())) 3961 if (!dart.notNull(it.moveNext()))
3962 throw _internal.IterableElementError.noElement(); 3962 throw _internal.IterableElementError.noElement();
3963 let result = dart.as(it.current, E); 3963 let result = dart.as(it.current, E);
3964 return result; 3964 return result;
3965 } 3965 }
3966 toString() { 3966 toString() {
3967 return IterableBase.iterableToFullString(this, '{', '}'); 3967 return IterableBase.iterableToFullString(this, '{', '}');
3968 } 3968 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
4062 for (let element of this) { 4062 for (let element of this) {
4063 if (test(element)) 4063 if (test(element))
4064 return element; 4064 return element;
4065 } 4065 }
4066 if (orElse !== null) 4066 if (orElse !== null)
4067 return orElse(); 4067 return orElse();
4068 throw _internal.IterableElementError.noElement(); 4068 throw _internal.IterableElementError.noElement();
4069 } 4069 }
4070 lastWhere(test, opt$) { 4070 lastWhere(test, opt$) {
4071 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; 4071 let orElse = opt$.orElse === void 0 ? null : opt$.orElse;
4072 let result = dart.as(null, E); 4072 let result = null;
4073 let foundMatching = false; 4073 let foundMatching = false;
4074 for (let element of this) { 4074 for (let element of this) {
4075 if (test(element)) { 4075 if (test(element)) {
4076 result = element; 4076 result = element;
4077 foundMatching = true; 4077 foundMatching = true;
4078 } 4078 }
4079 } 4079 }
4080 if (foundMatching) 4080 if (foundMatching)
4081 return result; 4081 return result;
4082 if (orElse !== null) 4082 if (orElse !== null)
4083 return orElse(); 4083 return orElse();
4084 throw _internal.IterableElementError.noElement(); 4084 throw _internal.IterableElementError.noElement();
4085 } 4085 }
4086 singleWhere(test) { 4086 singleWhere(test) {
4087 let result = dart.as(null, E); 4087 let result = null;
4088 let foundMatching = false; 4088 let foundMatching = false;
4089 for (let element of this) { 4089 for (let element of this) {
4090 if (test(element)) { 4090 if (test(element)) {
4091 if (foundMatching) { 4091 if (foundMatching) {
4092 throw _internal.IterableElementError.tooMany(); 4092 throw _internal.IterableElementError.tooMany();
4093 } 4093 }
4094 result = element; 4094 result = element;
4095 foundMatching = true; 4095 foundMatching = true;
4096 } 4096 }
4097 } 4097 }
4098 if (foundMatching) 4098 if (foundMatching)
4099 return result; 4099 return result;
4100 throw _internal.IterableElementError.noElement(); 4100 throw _internal.IterableElementError.noElement();
4101 } 4101 }
4102 elementAt(index) { 4102 elementAt(index) {
4103 if (!(typeof index == number)) 4103 if (!(typeof index == number))
4104 throw new core.ArgumentError.notNull("index"); 4104 throw new core.ArgumentError.notNull("index");
4105 core.RangeError.checkNotNegative(index, "index"); 4105 core.RangeError.checkNotNegative(index, "index");
4106 let elementIndex = 0; 4106 let elementIndex = 0;
4107 for (let element of this) { 4107 for (let element of this) {
4108 if (index === elementIndex) 4108 if (index === elementIndex)
4109 return element; 4109 return element;
4110 elementIndex++; 4110 dart.notNull(elementIndex)++;
4111 } 4111 }
4112 throw new core.RangeError.index(index, this, "index", null, elementIndex ); 4112 throw new core.RangeError.index(index, this, "index", null, elementIndex );
4113 } 4113 }
4114 } 4114 }
4115 return SetMixin; 4115 return SetMixin;
4116 }); 4116 });
4117 let SetMixin = SetMixin$(dynamic); 4117 let SetMixin = SetMixin$(dynamic);
4118 let SetBase$ = dart.generic(function(E) { 4118 let SetBase$ = dart.generic(function(E) {
4119 class SetBase extends SetMixin$(E) { 4119 class SetBase extends SetMixin$(E) {
4120 static setToString(set) { 4120 static setToString(set) {
(...skipping 30 matching lines...) Expand all
4151 let _splayCount = Symbol('_splayCount'); 4151 let _splayCount = Symbol('_splayCount');
4152 let _splay = Symbol('_splay'); 4152 let _splay = Symbol('_splay');
4153 let _compare = Symbol('_compare'); 4153 let _compare = Symbol('_compare');
4154 let _splayMin = Symbol('_splayMin'); 4154 let _splayMin = Symbol('_splayMin');
4155 let _splayMax = Symbol('_splayMax'); 4155 let _splayMax = Symbol('_splayMax');
4156 let _addNewRoot = Symbol('_addNewRoot'); 4156 let _addNewRoot = Symbol('_addNewRoot');
4157 let _clear = Symbol('_clear'); 4157 let _clear = Symbol('_clear');
4158 let _SplayTree$ = dart.generic(function(K) { 4158 let _SplayTree$ = dart.generic(function(K) {
4159 class _SplayTree extends dart.Object { 4159 class _SplayTree extends dart.Object {
4160 _SplayTree() { 4160 _SplayTree() {
4161 this[_dummy] = new _SplayTreeNode(dart.as(null, K)); 4161 this[_dummy] = new _SplayTreeNode(null);
4162 this[_root] = null; 4162 this[_root] = null;
4163 this[_count] = 0; 4163 this[_count] = 0;
4164 this[_modificationCount] = 0; 4164 this[_modificationCount] = 0;
4165 this[_splayCount] = 0; 4165 this[_splayCount] = 0;
4166 } 4166 }
4167 [_splay](key) { 4167 [_splay](key) {
4168 if (this[_root] === null) 4168 if (this[_root] === null)
4169 return -1; 4169 return -1;
4170 let left = this[_dummy]; 4170 let left = this[_dummy];
4171 let right = this[_dummy]; 4171 let right = this[_dummy];
4172 let current = this[_root]; 4172 let current = this[_root];
4173 let comp = null; 4173 let comp = null;
4174 while (true) { 4174 while (true) {
4175 comp = this[_compare](current.key, key); 4175 comp = this[_compare](current.key, key);
4176 if (comp > 0) { 4176 if (dart.notNull(comp) > 0) {
4177 if (current.left === null) 4177 if (current.left === null)
4178 break; 4178 break;
4179 comp = this[_compare](current.left.key, key); 4179 comp = this[_compare](current.left.key, key);
4180 if (comp > 0) { 4180 if (dart.notNull(comp) > 0) {
4181 let tmp = current.left; 4181 let tmp = current.left;
4182 current.left = tmp.right; 4182 current.left = tmp.right;
4183 tmp.right = current; 4183 tmp.right = current;
4184 current = tmp; 4184 current = tmp;
4185 if (current.left === null) 4185 if (current.left === null)
4186 break; 4186 break;
4187 } 4187 }
4188 right.left = current; 4188 right.left = current;
4189 right = current; 4189 right = current;
4190 current = current.left; 4190 current = current.left;
4191 } else if (comp < 0) { 4191 } else if (dart.notNull(comp) < 0) {
4192 if (current.right === null) 4192 if (current.right === null)
4193 break; 4193 break;
4194 comp = this[_compare](current.right.key, key); 4194 comp = this[_compare](current.right.key, key);
4195 if (comp < 0) { 4195 if (dart.notNull(comp) < 0) {
4196 let tmp = current.right; 4196 let tmp = current.right;
4197 current.right = tmp.left; 4197 current.right = tmp.left;
4198 tmp.left = current; 4198 tmp.left = current;
4199 current = tmp; 4199 current = tmp;
4200 if (current.right === null) 4200 if (current.right === null)
4201 break; 4201 break;
4202 } 4202 }
4203 left.right = current; 4203 left.right = current;
4204 left = current; 4204 left = current;
4205 current = current.right; 4205 current = current.right;
4206 } else { 4206 } else {
4207 break; 4207 break;
4208 } 4208 }
4209 } 4209 }
4210 left.right = current.left; 4210 left.right = current.left;
4211 right.left = current.right; 4211 right.left = current.right;
4212 current.left = this[_dummy].right; 4212 current.left = this[_dummy].right;
4213 current.right = this[_dummy].left; 4213 current.right = this[_dummy].left;
4214 this[_root] = current; 4214 this[_root] = current;
4215 this[_dummy].right = null; 4215 this[_dummy].right = null;
4216 this[_dummy].left = null; 4216 this[_dummy].left = null;
4217 this[_splayCount]++; 4217 dart.notNull(this[_splayCount])++;
4218 return comp; 4218 return comp;
4219 } 4219 }
4220 [_splayMin](node) { 4220 [_splayMin](node) {
4221 let current = node; 4221 let current = node;
4222 while (current.left !== null) { 4222 while (current.left !== null) {
4223 let left = current.left; 4223 let left = current.left;
4224 current.left = left.right; 4224 current.left = left.right;
4225 left.right = current; 4225 left.right = current;
4226 current = left; 4226 current = left;
4227 } 4227 }
4228 return dart.as(current, _SplayTreeNode$(K)); 4228 return dart.as(current, _SplayTreeNode$(K));
4229 } 4229 }
4230 [_splayMax](node) { 4230 [_splayMax](node) {
4231 let current = node; 4231 let current = node;
4232 while (current.right !== null) { 4232 while (current.right !== null) {
4233 let right = current.right; 4233 let right = current.right;
4234 current.right = right.left; 4234 current.right = right.left;
4235 right.left = current; 4235 right.left = current;
4236 current = right; 4236 current = right;
4237 } 4237 }
4238 return dart.as(current, _SplayTreeNode$(K)); 4238 return dart.as(current, _SplayTreeNode$(K));
4239 } 4239 }
4240 [_remove](key) { 4240 [_remove](key) {
4241 if (this[_root] === null) 4241 if (this[_root] === null)
4242 return null; 4242 return null;
4243 let comp = this[_splay](key); 4243 let comp = this[_splay](key);
4244 if (comp !== 0) 4244 if (comp !== 0)
4245 return null; 4245 return null;
4246 let result = this[_root]; 4246 let result = this[_root];
4247 this[_count]--; 4247 dart.notNull(this[_count])--;
4248 if (this[_root].left === null) { 4248 if (this[_root].left === null) {
4249 this[_root] = this[_root].right; 4249 this[_root] = this[_root].right;
4250 } else { 4250 } else {
4251 let right = this[_root].right; 4251 let right = this[_root].right;
4252 this[_root] = this[_splayMax](this[_root].left); 4252 this[_root] = this[_splayMax](this[_root].left);
4253 this[_root].right = right; 4253 this[_root].right = right;
4254 } 4254 }
4255 this[_modificationCount]++; 4255 dart.notNull(this[_modificationCount])++;
4256 return result; 4256 return result;
4257 } 4257 }
4258 [_addNewRoot](node, comp) { 4258 [_addNewRoot](node, comp) {
4259 this[_count]++; 4259 dart.notNull(this[_count])++;
4260 this[_modificationCount]++; 4260 dart.notNull(this[_modificationCount])++;
4261 if (this[_root] === null) { 4261 if (this[_root] === null) {
4262 this[_root] = node; 4262 this[_root] = node;
4263 return; 4263 return;
4264 } 4264 }
4265 if (comp < 0) { 4265 if (dart.notNull(comp) < 0) {
4266 node.left = this[_root]; 4266 node.left = this[_root];
4267 node.right = this[_root].right; 4267 node.right = this[_root].right;
4268 this[_root].right = null; 4268 this[_root].right = null;
4269 } else { 4269 } else {
4270 node.right = this[_root]; 4270 node.right = this[_root];
4271 node.left = this[_root].left; 4271 node.left = this[_root].left;
4272 this[_root].left = null; 4272 this[_root].left = null;
4273 } 4273 }
4274 this[_root] = node; 4274 this[_root] = node;
4275 } 4275 }
4276 get [_first]() { 4276 get [_first]() {
4277 if (this[_root] === null) 4277 if (this[_root] === null)
4278 return null; 4278 return null;
4279 this[_root] = this[_splayMin](this[_root]); 4279 this[_root] = this[_splayMin](this[_root]);
4280 return this[_root]; 4280 return this[_root];
4281 } 4281 }
4282 get [_last]() { 4282 get [_last]() {
4283 if (this[_root] === null) 4283 if (this[_root] === null)
4284 return null; 4284 return null;
4285 this[_root] = this[_splayMax](this[_root]); 4285 this[_root] = this[_splayMax](this[_root]);
4286 return this[_root]; 4286 return this[_root];
4287 } 4287 }
4288 [_clear]() { 4288 [_clear]() {
4289 this[_root] = null; 4289 this[_root] = null;
4290 this[_count] = 0; 4290 this[_count] = 0;
4291 this[_modificationCount]++; 4291 dart.notNull(this[_modificationCount])++;
4292 } 4292 }
4293 } 4293 }
4294 return _SplayTree; 4294 return _SplayTree;
4295 }); 4295 });
4296 let _SplayTree = _SplayTree$(dynamic); 4296 let _SplayTree = _SplayTree$(dynamic);
4297 let _TypeTest$ = dart.generic(function(T) { 4297 let _TypeTest$ = dart.generic(function(T) {
4298 class _TypeTest extends dart.Object { 4298 class _TypeTest extends dart.Object {
4299 test(v) { 4299 test(v) {
4300 return dart.is(v, T); 4300 return dart.is(v, T);
4301 } 4301 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
4349 } 4349 }
4350 SplayTreeMap$_internal() { 4350 SplayTreeMap$_internal() {
4351 this[_comparator] = null; 4351 this[_comparator] = null;
4352 this[_validKey] = null; 4352 this[_validKey] = null;
4353 super._SplayTree(); 4353 super._SplayTree();
4354 } 4354 }
4355 get(key) { 4355 get(key) {
4356 if (key === null) 4356 if (key === null)
4357 throw new core.ArgumentError(key); 4357 throw new core.ArgumentError(key);
4358 if (!dart.notNull(this[_validKey](key))) 4358 if (!dart.notNull(this[_validKey](key)))
4359 return dart.as(null, V); 4359 return null;
4360 if (this[_root] !== null) { 4360 if (this[_root] !== null) {
4361 let comp = this[_splay](dart.as(key, K)); 4361 let comp = this[_splay](dart.as(key, K));
4362 if (comp === 0) { 4362 if (comp === 0) {
4363 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 4363 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
4364 return dart.as(mapRoot.value, V); 4364 return dart.as(mapRoot.value, V);
4365 } 4365 }
4366 } 4366 }
4367 return dart.as(null, V); 4367 return null;
4368 } 4368 }
4369 remove(key) { 4369 remove(key) {
4370 if (!dart.notNull(this[_validKey](key))) 4370 if (!dart.notNull(this[_validKey](key)))
4371 return dart.as(null, V); 4371 return null;
4372 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode) ; 4372 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode) ;
4373 if (mapRoot !== null) 4373 if (mapRoot !== null)
4374 return dart.as(mapRoot.value, V); 4374 return dart.as(mapRoot.value, V);
4375 return dart.as(null, V); 4375 return null;
4376 } 4376 }
4377 set(key, value) { 4377 set(key, value) {
4378 if (key === null) 4378 if (key === null)
4379 throw new core.ArgumentError(key); 4379 throw new core.ArgumentError(key);
4380 let comp = this[_splay](key); 4380 let comp = this[_splay](key);
4381 if (comp === 0) { 4381 if (comp === 0) {
4382 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 4382 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
4383 mapRoot.value = value; 4383 mapRoot.value = value;
4384 return; 4384 return;
4385 } 4385 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
4424 f(node.key, node.value); 4424 f(node.key, node.value);
4425 } 4425 }
4426 } 4426 }
4427 get length() { 4427 get length() {
4428 return this[_count]; 4428 return this[_count];
4429 } 4429 }
4430 clear() { 4430 clear() {
4431 this[_clear](); 4431 this[_clear]();
4432 } 4432 }
4433 containsKey(key) { 4433 containsKey(key) {
4434 return dart.notNull(this[_validKey](key)) && dart.notNull(this[_splay](d art.as(key, K)) === 0); 4434 return dart.notNull(this[_validKey](key)) && this[_splay](dart.as(key, K )) === 0;
4435 } 4435 }
4436 containsValue(value) { 4436 containsValue(value) {
4437 let found = false; 4437 let found = false;
4438 let initialSplayCount = this[_splayCount]; 4438 let initialSplayCount = this[_splayCount];
4439 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool 4439 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool
4440 function visit(node) { 4440 function visit(node) {
4441 while (node !== null) { 4441 while (node !== null) {
4442 if (dart.equals(node.value, value)) 4442 if (dart.equals(node.value, value))
4443 return true; 4443 return true;
4444 if (initialSplayCount !== this[_splayCount]) { 4444 if (initialSplayCount !== this[_splayCount]) {
(...skipping 11 matching lines...) Expand all
4456 return new _SplayTreeKeyIterable(this); 4456 return new _SplayTreeKeyIterable(this);
4457 } 4457 }
4458 get values() { 4458 get values() {
4459 return new _SplayTreeValueIterable(this); 4459 return new _SplayTreeValueIterable(this);
4460 } 4460 }
4461 toString() { 4461 toString() {
4462 return Maps.mapToString(this); 4462 return Maps.mapToString(this);
4463 } 4463 }
4464 firstKey() { 4464 firstKey() {
4465 if (this[_root] === null) 4465 if (this[_root] === null)
4466 return dart.as(null, K); 4466 return null;
4467 return dart.as(this[_first].key, K); 4467 return dart.as(this[_first].key, K);
4468 } 4468 }
4469 lastKey() { 4469 lastKey() {
4470 if (this[_root] === null) 4470 if (this[_root] === null)
4471 return dart.as(null, K); 4471 return null;
4472 return dart.as(this[_last].key, K); 4472 return dart.as(this[_last].key, K);
4473 } 4473 }
4474 lastKeyBefore(key) { 4474 lastKeyBefore(key) {
4475 if (key === null) 4475 if (key === null)
4476 throw new core.ArgumentError(key); 4476 throw new core.ArgumentError(key);
4477 if (this[_root] === null) 4477 if (this[_root] === null)
4478 return dart.as(null, K); 4478 return null;
4479 let comp = this[_splay](key); 4479 let comp = this[_splay](key);
4480 if (comp < 0) 4480 if (dart.notNull(comp) < 0)
4481 return this[_root].key; 4481 return this[_root].key;
4482 let node = this[_root].left; 4482 let node = this[_root].left;
4483 if (node === null) 4483 if (node === null)
4484 return dart.as(null, K); 4484 return null;
4485 while (node.right !== null) { 4485 while (node.right !== null) {
4486 node = node.right; 4486 node = node.right;
4487 } 4487 }
4488 return node.key; 4488 return node.key;
4489 } 4489 }
4490 firstKeyAfter(key) { 4490 firstKeyAfter(key) {
4491 if (key === null) 4491 if (key === null)
4492 throw new core.ArgumentError(key); 4492 throw new core.ArgumentError(key);
4493 if (this[_root] === null) 4493 if (this[_root] === null)
4494 return dart.as(null, K); 4494 return null;
4495 let comp = this[_splay](key); 4495 let comp = this[_splay](key);
4496 if (comp > 0) 4496 if (dart.notNull(comp) > 0)
4497 return this[_root].key; 4497 return this[_root].key;
4498 let node = this[_root].right; 4498 let node = this[_root].right;
4499 if (node === null) 4499 if (node === null)
4500 return dart.as(null, K); 4500 return null;
4501 while (node.left !== null) { 4501 while (node.left !== null) {
4502 node = node.left; 4502 node = node.left;
4503 } 4503 }
4504 return node.key; 4504 return node.key;
4505 } 4505 }
4506 } 4506 }
4507 dart.defineNamedConstructor(SplayTreeMap, 'from'); 4507 dart.defineNamedConstructor(SplayTreeMap, 'from');
4508 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); 4508 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable');
4509 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); 4509 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables');
4510 dart.defineNamedConstructor(SplayTreeMap, '_internal'); 4510 dart.defineNamedConstructor(SplayTreeMap, '_internal');
(...skipping 13 matching lines...) Expand all
4524 this[_tree] = tree; 4524 this[_tree] = tree;
4525 this[_modificationCount] = tree[_modificationCount]; 4525 this[_modificationCount] = tree[_modificationCount];
4526 this[_splayCount] = tree[_splayCount]; 4526 this[_splayCount] = tree[_splayCount];
4527 this[_currentNode] = null; 4527 this[_currentNode] = null;
4528 this[_findLeftMostDescendent](tree[_root]); 4528 this[_findLeftMostDescendent](tree[_root]);
4529 } 4529 }
4530 _SplayTreeIterator$startAt(tree, startKey) { 4530 _SplayTreeIterator$startAt(tree, startKey) {
4531 this[_workList] = new List.from([]); 4531 this[_workList] = new List.from([]);
4532 this[_tree] = tree; 4532 this[_tree] = tree;
4533 this[_modificationCount] = tree[_modificationCount]; 4533 this[_modificationCount] = tree[_modificationCount];
4534 this[_splayCount] = dart.as(null, core.int); 4534 this[_splayCount] = null;
4535 this[_currentNode] = null; 4535 this[_currentNode] = null;
4536 if (tree[_root] === null) 4536 if (tree[_root] === null)
4537 return; 4537 return;
4538 let compare = tree._splay(startKey); 4538 let compare = tree._splay(startKey);
4539 this[_splayCount] = tree[_splayCount]; 4539 this[_splayCount] = tree[_splayCount];
4540 if (compare < 0) { 4540 if (dart.notNull(compare) < 0) {
4541 this[_findLeftMostDescendent](tree[_root].right); 4541 this[_findLeftMostDescendent](tree[_root].right);
4542 } else { 4542 } else {
4543 this[_workList].add(tree[_root]); 4543 this[_workList].add(tree[_root]);
4544 } 4544 }
4545 } 4545 }
4546 get current() { 4546 get current() {
4547 if (this[_currentNode] === null) 4547 if (this[_currentNode] === null)
4548 return dart.as(null, T); 4548 return null;
4549 return this[_getValue](this[_currentNode]); 4549 return this[_getValue](this[_currentNode]);
4550 } 4550 }
4551 [_findLeftMostDescendent](node) { 4551 [_findLeftMostDescendent](node) {
4552 while (node !== null) { 4552 while (node !== null) {
4553 this[_workList].add(node); 4553 this[_workList].add(node);
4554 node = node.left; 4554 node = node.left;
4555 } 4555 }
4556 } 4556 }
4557 [_rebuildWorkList](currentNode) { 4557 [_rebuildWorkList](currentNode) {
4558 dart.assert(!dart.notNull(this[_workList].isEmpty)); 4558 dart.assert(!dart.notNull(this[_workList].isEmpty));
4559 this[_workList].clear(); 4559 this[_workList].clear();
4560 if (currentNode === null) { 4560 if (currentNode === null) {
4561 this[_findLeftMostDescendent](this[_tree][_root]); 4561 this[_findLeftMostDescendent](this[_tree][_root]);
4562 } else { 4562 } else {
4563 this[_tree]._splay(currentNode.key); 4563 this[_tree]._splay(currentNode.key);
4564 this[_findLeftMostDescendent](this[_tree][_root].right); 4564 this[_findLeftMostDescendent](this[_tree][_root].right);
4565 dart.assert(!dart.notNull(this[_workList].isEmpty)); 4565 dart.assert(!dart.notNull(this[_workList].isEmpty));
4566 } 4566 }
4567 } 4567 }
4568 moveNext() { 4568 moveNext() {
4569 if (this[_modificationCount] !== this[_tree][_modificationCount]) { 4569 if (this[_modificationCount] !== this[_tree][_modificationCount]) {
4570 throw new core.ConcurrentModificationError(this[_tree]); 4570 throw new core.ConcurrentModificationError(this[_tree]);
4571 } 4571 }
4572 if (this[_workList].isEmpty) { 4572 if (this[_workList].isEmpty) {
4573 this[_currentNode] = null; 4573 this[_currentNode] = null;
4574 return false; 4574 return false;
4575 } 4575 }
4576 if (dart.notNull(this[_tree][_splayCount] !== this[_splayCount]) && dart .notNull(this[_currentNode] !== null)) { 4576 if (this[_tree][_splayCount] !== this[_splayCount] && dart.notNull(this[ _currentNode] !== null)) {
4577 this[_rebuildWorkList](this[_currentNode]); 4577 this[_rebuildWorkList](this[_currentNode]);
4578 } 4578 }
4579 this[_currentNode] = this[_workList].removeLast(); 4579 this[_currentNode] = this[_workList].removeLast();
4580 this[_findLeftMostDescendent](this[_currentNode].right); 4580 this[_findLeftMostDescendent](this[_currentNode].right);
4581 return true; 4581 return true;
4582 } 4582 }
4583 } 4583 }
4584 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); 4584 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt');
4585 return _SplayTreeIterator; 4585 return _SplayTreeIterator;
4586 }); 4586 });
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
4715 return dart.as(this[_first].key, E); 4715 return dart.as(this[_first].key, E);
4716 } 4716 }
4717 get last() { 4717 get last() {
4718 if (this[_count] === 0) 4718 if (this[_count] === 0)
4719 throw _internal.IterableElementError.noElement(); 4719 throw _internal.IterableElementError.noElement();
4720 return dart.as(this[_last].key, E); 4720 return dart.as(this[_last].key, E);
4721 } 4721 }
4722 get single() { 4722 get single() {
4723 if (this[_count] === 0) 4723 if (this[_count] === 0)
4724 throw _internal.IterableElementError.noElement(); 4724 throw _internal.IterableElementError.noElement();
4725 if (this[_count] > 1) 4725 if (dart.notNull(this[_count]) > 1)
4726 throw _internal.IterableElementError.tooMany(); 4726 throw _internal.IterableElementError.tooMany();
4727 return this[_root].key; 4727 return this[_root].key;
4728 } 4728 }
4729 contains(object) { 4729 contains(object) {
4730 return dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay ](dart.as(object, E)) === 0); 4730 return dart.notNull(this[_validKey](object)) && this[_splay](dart.as(obj ect, E)) === 0;
4731 } 4731 }
4732 add(element) { 4732 add(element) {
4733 let compare = this[_splay](element); 4733 let compare = this[_splay](element);
4734 if (compare === 0) 4734 if (compare === 0)
4735 return false; 4735 return false;
4736 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E )), compare); 4736 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E )), compare);
4737 return true; 4737 return true;
4738 } 4738 }
4739 remove(object) { 4739 remove(object) {
4740 if (!dart.notNull(this[_validKey](object))) 4740 if (!dart.notNull(this[_validKey](object)))
(...skipping 14 matching lines...) Expand all
4755 this[_remove](dart.as(element, E)); 4755 this[_remove](dart.as(element, E));
4756 } 4756 }
4757 } 4757 }
4758 retainAll(elements) { 4758 retainAll(elements) {
4759 let retainSet = new SplayTreeSet(this[_comparator], this[_validKey]); 4759 let retainSet = new SplayTreeSet(this[_comparator], this[_validKey]);
4760 let modificationCount = this[_modificationCount]; 4760 let modificationCount = this[_modificationCount];
4761 for (let object of elements) { 4761 for (let object of elements) {
4762 if (modificationCount !== this[_modificationCount]) { 4762 if (modificationCount !== this[_modificationCount]) {
4763 throw new core.ConcurrentModificationError(this); 4763 throw new core.ConcurrentModificationError(this);
4764 } 4764 }
4765 if (dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay] (dart.as(object, E)) === 0)) 4765 if (dart.notNull(this[_validKey](object)) && this[_splay](dart.as(obje ct, E)) === 0)
4766 retainSet.add(this[_root].key); 4766 retainSet.add(this[_root].key);
4767 } 4767 }
4768 if (retainSet[_count] !== this[_count]) { 4768 if (retainSet[_count] !== this[_count]) {
4769 this[_root] = retainSet[_root]; 4769 this[_root] = retainSet[_root];
4770 this[_count] = retainSet[_count]; 4770 this[_count] = retainSet[_count];
4771 this[_modificationCount]++; 4771 dart.notNull(this[_modificationCount])++;
4772 } 4772 }
4773 } 4773 }
4774 lookup(object) { 4774 lookup(object) {
4775 if (!dart.notNull(this[_validKey](object))) 4775 if (!dart.notNull(this[_validKey](object)))
4776 return dart.as(null, E); 4776 return null;
4777 let comp = this[_splay](dart.as(object, E)); 4777 let comp = this[_splay](dart.as(object, E));
4778 if (comp !== 0) 4778 if (comp !== 0)
4779 return dart.as(null, E); 4779 return null;
4780 return this[_root].key; 4780 return this[_root].key;
4781 } 4781 }
4782 intersection(other) { 4782 intersection(other) {
4783 let result = new SplayTreeSet(this[_comparator], this[_validKey]); 4783 let result = new SplayTreeSet(this[_comparator], this[_validKey]);
4784 for (let element of this) { 4784 for (let element of this) {
4785 if (other.contains(element)) 4785 if (other.contains(element))
4786 result.add(element); 4786 result.add(element);
4787 } 4787 }
4788 return result; 4788 return result;
4789 } 4789 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
4890 exports.ListQueue$ = ListQueue$; 4890 exports.ListQueue$ = ListQueue$;
4891 exports.SetMixin = SetMixin; 4891 exports.SetMixin = SetMixin;
4892 exports.SetMixin$ = SetMixin$; 4892 exports.SetMixin$ = SetMixin$;
4893 exports.SetBase = SetBase; 4893 exports.SetBase = SetBase;
4894 exports.SetBase$ = SetBase$; 4894 exports.SetBase$ = SetBase$;
4895 exports.SplayTreeMap = SplayTreeMap; 4895 exports.SplayTreeMap = SplayTreeMap;
4896 exports.SplayTreeMap$ = SplayTreeMap$; 4896 exports.SplayTreeMap$ = SplayTreeMap$;
4897 exports.SplayTreeSet = SplayTreeSet; 4897 exports.SplayTreeSet = SplayTreeSet;
4898 exports.SplayTreeSet$ = SplayTreeSet$; 4898 exports.SplayTreeSet$ = SplayTreeSet$;
4899 })(collection || (collection = {})); 4899 })(collection || (collection = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698