| OLD | NEW |
| 1 var _internal; | 1 var _internal; |
| 2 (function (_internal) { | 2 (function(_internal) { |
| 3 'use strict'; | 3 'use strict'; |
| 4 let POWERS_OF_TEN = /* Unimplemented const */new List.from([1.0, 10.0, 100.0,
1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 100
00000000.0, 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0
, 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, 100000000000000
0000.0, 10000000000000000000.0, 100000000000000000000.0, 1e+21, 1e+22]); | 4 let POWERS_OF_TEN = /* Unimplemented const */new List.from([1.0, 10.0, 100.0,
1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 100
00000000.0, 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0
, 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, 100000000000000
0000.0, 10000000000000000000.0, 100000000000000000000.0, 1e+21, 1e+22]); |
| 5 class EfficientLength extends dart.Object { | 5 class EfficientLength extends dart.Object { |
| 6 } | 6 } |
| 7 | |
| 8 let ListIterable$ = dart.generic(function(E) { | 7 let ListIterable$ = dart.generic(function(E) { |
| 9 class ListIterable extends collection.IterableBase$(E) { | 8 class ListIterable extends collection.IterableBase$(E) { |
| 10 ListIterable() { | 9 ListIterable() { |
| 11 super.IterableBase(); | 10 super.IterableBase(); |
| 12 } | 11 } |
| 13 get iterator() { return new ListIterator(this); } | 12 get iterator() { |
| 13 return new ListIterator(this); |
| 14 } |
| 14 forEach(action) { | 15 forEach(action) { |
| 15 let length = this.length; | 16 let length = this.length; |
| 16 for (let i = 0; i < length; i++) { | 17 for (let i = 0; i < length; i++) { |
| 17 action(this.elementAt(i)); | 18 action(this.elementAt(i)); |
| 18 if (length !== this.length) { | 19 if (length !== this.length) { |
| 19 throw new core.ConcurrentModificationError(this); | 20 throw new core.ConcurrentModificationError(this); |
| 20 } | 21 } |
| 21 } | 22 } |
| 22 } | 23 } |
| 23 get isEmpty() { return this.length === 0; } | 24 get isEmpty() { |
| 25 return this.length === 0; |
| 26 } |
| 24 get first() { | 27 get first() { |
| 25 if (this.length === 0) throw IterableElementError.noElement(); | 28 if (this.length === 0) |
| 29 throw IterableElementError.noElement(); |
| 26 return this.elementAt(0); | 30 return this.elementAt(0); |
| 27 } | 31 } |
| 28 get last() { | 32 get last() { |
| 29 if (this.length === 0) throw IterableElementError.noElement(); | 33 if (this.length === 0) |
| 34 throw IterableElementError.noElement(); |
| 30 return this.elementAt(this.length - 1); | 35 return this.elementAt(this.length - 1); |
| 31 } | 36 } |
| 32 get single() { | 37 get single() { |
| 33 if (this.length === 0) throw IterableElementError.noElement(); | 38 if (this.length === 0) |
| 34 if (this.length > 1) throw IterableElementError.tooMany(); | 39 throw IterableElementError.noElement(); |
| 40 if (this.length > 1) |
| 41 throw IterableElementError.tooMany(); |
| 35 return this.elementAt(0); | 42 return this.elementAt(0); |
| 36 } | 43 } |
| 37 contains(element) { | 44 contains(element) { |
| 38 let length = this.length; | 45 let length = this.length; |
| 39 for (let i = 0; i < length; i++) { | 46 for (let i = 0; i < length; i++) { |
| 40 if (dart.equals(this.elementAt(i), element)) return true; | 47 if (dart.equals(this.elementAt(i), element)) |
| 48 return true; |
| 41 if (length !== this.length) { | 49 if (length !== this.length) { |
| 42 throw new core.ConcurrentModificationError(this); | 50 throw new core.ConcurrentModificationError(this); |
| 43 } | 51 } |
| 44 } | 52 } |
| 45 return false; | 53 return false; |
| 46 } | 54 } |
| 47 every(test) { | 55 every(test) { |
| 48 let length = this.length; | 56 let length = this.length; |
| 49 for (let i = 0; i < length; i++) { | 57 for (let i = 0; i < length; i++) { |
| 50 if (!dart.notNull(test(this.elementAt(i)))) return false; | 58 if (!dart.notNull(test(this.elementAt(i)))) |
| 59 return false; |
| 51 if (length !== this.length) { | 60 if (length !== this.length) { |
| 52 throw new core.ConcurrentModificationError(this); | 61 throw new core.ConcurrentModificationError(this); |
| 53 } | 62 } |
| 54 } | 63 } |
| 55 return true; | 64 return true; |
| 56 } | 65 } |
| 57 any(test) { | 66 any(test) { |
| 58 let length = this.length; | 67 let length = this.length; |
| 59 for (let i = 0; i < length; i++) { | 68 for (let i = 0; i < length; i++) { |
| 60 if (test(this.elementAt(i))) return true; | 69 if (test(this.elementAt(i))) |
| 70 return true; |
| 61 if (length !== this.length) { | 71 if (length !== this.length) { |
| 62 throw new core.ConcurrentModificationError(this); | 72 throw new core.ConcurrentModificationError(this); |
| 63 } | 73 } |
| 64 } | 74 } |
| 65 return false; | 75 return false; |
| 66 } | 76 } |
| 67 firstWhere(test, opt$) { | 77 firstWhere(test, opt$) { |
| 68 let orElse = opt$.orElse === undefined ? null : opt$.orElse; | 78 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 69 let length = this.length; | 79 let length = this.length; |
| 70 for (let i = 0; i < length; i++) { | 80 for (let i = 0; i < length; i++) { |
| 71 let element = this.elementAt(i); | 81 let element = this.elementAt(i); |
| 72 if (test(element)) return element; | 82 if (test(element)) |
| 83 return element; |
| 73 if (length !== this.length) { | 84 if (length !== this.length) { |
| 74 throw new core.ConcurrentModificationError(this); | 85 throw new core.ConcurrentModificationError(this); |
| 75 } | 86 } |
| 76 } | 87 } |
| 77 if (orElse !== null) return orElse(); | 88 if (orElse !== null) |
| 89 return orElse(); |
| 78 throw IterableElementError.noElement(); | 90 throw IterableElementError.noElement(); |
| 79 } | 91 } |
| 80 lastWhere(test, opt$) { | 92 lastWhere(test, opt$) { |
| 81 let orElse = opt$.orElse === undefined ? null : opt$.orElse; | 93 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 82 let length = this.length; | 94 let length = this.length; |
| 83 for (let i = length - 1; i >= 0; i--) { | 95 for (let i = length - 1; i >= 0; i--) { |
| 84 let element = this.elementAt(i); | 96 let element = this.elementAt(i); |
| 85 if (test(element)) return element; | 97 if (test(element)) |
| 98 return element; |
| 86 if (length !== this.length) { | 99 if (length !== this.length) { |
| 87 throw new core.ConcurrentModificationError(this); | 100 throw new core.ConcurrentModificationError(this); |
| 88 } | 101 } |
| 89 } | 102 } |
| 90 if (orElse !== null) return orElse(); | 103 if (orElse !== null) |
| 104 return orElse(); |
| 91 throw IterableElementError.noElement(); | 105 throw IterableElementError.noElement(); |
| 92 } | 106 } |
| 93 singleWhere(test) { | 107 singleWhere(test) { |
| 94 let length = this.length; | 108 let length = this.length; |
| 95 let match = dart.as(null, E); | 109 let match = dart.as(null, E); |
| 96 let matchFound = false; | 110 let matchFound = false; |
| 97 for (let i = 0; i < length; i++) { | 111 for (let i = 0; i < length; i++) { |
| 98 let element = this.elementAt(i); | 112 let element = this.elementAt(i); |
| 99 if (test(element)) { | 113 if (test(element)) { |
| 100 if (matchFound) { | 114 if (matchFound) { |
| 101 throw IterableElementError.tooMany(); | 115 throw IterableElementError.tooMany(); |
| 102 } | 116 } |
| 103 matchFound = true; | 117 matchFound = true; |
| 104 match = element; | 118 match = element; |
| 105 } | 119 } |
| 106 if (length !== this.length) { | 120 if (length !== this.length) { |
| 107 throw new core.ConcurrentModificationError(this); | 121 throw new core.ConcurrentModificationError(this); |
| 108 } | 122 } |
| 109 } | 123 } |
| 110 if (matchFound) return match; | 124 if (matchFound) |
| 125 return match; |
| 111 throw IterableElementError.noElement(); | 126 throw IterableElementError.noElement(); |
| 112 } | 127 } |
| 113 join(separator) { | 128 join(separator) { |
| 114 if (separator === undefined) separator = ""; | 129 if (separator === void 0) |
| 130 separator = ""; |
| 115 let length = this.length; | 131 let length = this.length; |
| 116 if (!dart.notNull(separator.isEmpty)) { | 132 if (!dart.notNull(separator.isEmpty)) { |
| 117 if (length === 0) return ""; | 133 if (length === 0) |
| 134 return ""; |
| 118 let first = `${this.elementAt(0)}`; | 135 let first = `${this.elementAt(0)}`; |
| 119 if (length !== this.length) { | 136 if (length !== this.length) { |
| 120 throw new core.ConcurrentModificationError(this); | 137 throw new core.ConcurrentModificationError(this); |
| 121 } | 138 } |
| 122 let buffer = new core.StringBuffer(first); | 139 let buffer = new core.StringBuffer(first); |
| 123 for (let i = 1; i < length; i++) { | 140 for (let i = 1; i < length; i++) { |
| 124 buffer.write(separator); | 141 buffer.write(separator); |
| 125 buffer.write(this.elementAt(i)); | 142 buffer.write(this.elementAt(i)); |
| 126 if (length !== this.length) { | 143 if (length !== this.length) { |
| 127 throw new core.ConcurrentModificationError(this); | 144 throw new core.ConcurrentModificationError(this); |
| 128 } | 145 } |
| 129 } | 146 } |
| 130 return buffer.toString(); | 147 return buffer.toString(); |
| 131 } else { | 148 } else { |
| 132 let buffer = new core.StringBuffer(); | 149 let buffer = new core.StringBuffer(); |
| 133 for (let i = 0; i < length; i++) { | 150 for (let i = 0; i < length; i++) { |
| 134 buffer.write(this.elementAt(i)); | 151 buffer.write(this.elementAt(i)); |
| 135 if (length !== this.length) { | 152 if (length !== this.length) { |
| 136 throw new core.ConcurrentModificationError(this); | 153 throw new core.ConcurrentModificationError(this); |
| 137 } | 154 } |
| 138 } | 155 } |
| 139 return buffer.toString(); | 156 return buffer.toString(); |
| 140 } | 157 } |
| 141 } | 158 } |
| 142 where(test) { return super.where(test); } | 159 where(test) { |
| 143 map(f) { return new MappedListIterable(this, f); } | 160 return super.where(test); |
| 161 } |
| 162 map(f) { |
| 163 return new MappedListIterable(this, f); |
| 164 } |
| 144 reduce(combine) { | 165 reduce(combine) { |
| 145 let length = this.length; | 166 let length = this.length; |
| 146 if (length === 0) throw IterableElementError.noElement(); | 167 if (length === 0) |
| 168 throw IterableElementError.noElement(); |
| 147 let value = this.elementAt(0); | 169 let value = this.elementAt(0); |
| 148 for (let i = 1; i < length; i++) { | 170 for (let i = 1; i < length; i++) { |
| 149 value = combine(value, this.elementAt(i)); | 171 value = combine(value, this.elementAt(i)); |
| 150 if (length !== this.length) { | 172 if (length !== this.length) { |
| 151 throw new core.ConcurrentModificationError(this); | 173 throw new core.ConcurrentModificationError(this); |
| 152 } | 174 } |
| 153 } | 175 } |
| 154 return value; | 176 return value; |
| 155 } | 177 } |
| 156 fold(initialValue, combine) { | 178 fold(initialValue, combine) { |
| 157 let value = initialValue; | 179 let value = initialValue; |
| 158 let length = this.length; | 180 let length = this.length; |
| 159 for (let i = 0; i < length; i++) { | 181 for (let i = 0; i < length; i++) { |
| 160 value = combine(value, this.elementAt(i)); | 182 value = combine(value, this.elementAt(i)); |
| 161 if (length !== this.length) { | 183 if (length !== this.length) { |
| 162 throw new core.ConcurrentModificationError(this); | 184 throw new core.ConcurrentModificationError(this); |
| 163 } | 185 } |
| 164 } | 186 } |
| 165 return value; | 187 return value; |
| 166 } | 188 } |
| 167 skip(count) { return new SubListIterable(this, count, null); } | 189 skip(count) { |
| 168 skipWhile(test) { return super.skipWhile(test); } | 190 return new SubListIterable(this, count, null); |
| 169 take(count) { return new SubListIterable(this, 0, count); } | 191 } |
| 170 takeWhile(test) { return super.takeWhile(test); } | 192 skipWhile(test) { |
| 193 return super.skipWhile(test); |
| 194 } |
| 195 take(count) { |
| 196 return new SubListIterable(this, 0, count); |
| 197 } |
| 198 takeWhile(test) { |
| 199 return super.takeWhile(test); |
| 200 } |
| 171 toList(opt$) { | 201 toList(opt$) { |
| 172 let growable = opt$.growable === undefined ? true : opt$.growable; | 202 let growable = opt$.growable === void 0 ? true : opt$.growable; |
| 173 let result = null; | 203 let result = null; |
| 174 if (growable) { | 204 if (growable) { |
| 175 result = ((_) => { | 205 result = ((_) => { |
| 176 _.length = this.length; | 206 _.length = this.length; |
| 177 return _; | 207 return _; |
| 178 }).bind(this)(new core.List()); | 208 }).bind(this)(new core.List()); |
| 179 } else { | 209 } else { |
| 180 result = new core.List(this.length); | 210 result = new core.List(this.length); |
| 181 } | 211 } |
| 182 for (let i = 0; i < this.length; i++) { | 212 for (let i = 0; i < this.length; i++) { |
| 183 result.set(i, this.elementAt(i)); | 213 result.set(i, this.elementAt(i)); |
| 184 } | 214 } |
| 185 return result; | 215 return result; |
| 186 } | 216 } |
| 187 toSet() { | 217 toSet() { |
| 188 let result = new core.Set(); | 218 let result = new core.Set(); |
| 189 for (let i = 0; i < this.length; i++) { | 219 for (let i = 0; i < this.length; i++) { |
| 190 result.add(this.elementAt(i)); | 220 result.add(this.elementAt(i)); |
| 191 } | 221 } |
| 192 return result; | 222 return result; |
| 193 } | 223 } |
| 194 } | 224 } |
| 195 return ListIterable; | 225 return ListIterable; |
| 196 }); | 226 }); |
| 197 let ListIterable = ListIterable$(dynamic); | 227 let ListIterable = ListIterable$(dynamic); |
| 198 | |
| 199 let SubListIterable$ = dart.generic(function(E) { | 228 let SubListIterable$ = dart.generic(function(E) { |
| 200 class SubListIterable extends ListIterable$(E) { | 229 class SubListIterable extends ListIterable$(E) { |
| 201 SubListIterable(_iterable, _start, _endOrLength) { | 230 SubListIterable(_iterable, _start, _endOrLength) { |
| 202 this._iterable = _iterable; | 231 this._iterable = _iterable; |
| 203 this._start = _start; | 232 this._start = _start; |
| 204 this._endOrLength = _endOrLength; | 233 this._endOrLength = _endOrLength; |
| 205 super.ListIterable(); | 234 super.ListIterable(); |
| 206 core.RangeError.checkNotNegative(this._start, "start"); | 235 core.RangeError.checkNotNegative(this._start, "start"); |
| 207 if (this._endOrLength !== null) { | 236 if (this._endOrLength !== null) { |
| 208 core.RangeError.checkNotNegative(this._endOrLength, "end"); | 237 core.RangeError.checkNotNegative(this._endOrLength, "end"); |
| 209 if (this._start > this._endOrLength) { | 238 if (this._start > this._endOrLength) { |
| 210 throw new core.RangeError.range(this._start, 0, this._endOrLength, "
start"); | 239 throw new core.RangeError.range(this._start, 0, this._endOrLength, "
start"); |
| 211 } | 240 } |
| 212 } | 241 } |
| 213 } | 242 } |
| 214 get _endIndex() { | 243 get _endIndex() { |
| 215 let length = this._iterable.length; | 244 let length = this._iterable.length; |
| 216 if (dart.notNull(this._endOrLength === null) || dart.notNull(this._endOr
Length > length)) return length; | 245 if (dart.notNull(this._endOrLength === null) || dart.notNull(this._endOr
Length > length)) |
| 246 return length; |
| 217 return this._endOrLength; | 247 return this._endOrLength; |
| 218 } | 248 } |
| 219 get _startIndex() { | 249 get _startIndex() { |
| 220 let length = this._iterable.length; | 250 let length = this._iterable.length; |
| 221 if (this._start > length) return length; | 251 if (this._start > length) |
| 252 return length; |
| 222 return this._start; | 253 return this._start; |
| 223 } | 254 } |
| 224 get length() { | 255 get length() { |
| 225 let length = this._iterable.length; | 256 let length = this._iterable.length; |
| 226 if (this._start >= length) return 0; | 257 if (this._start >= length) |
| 258 return 0; |
| 227 if (dart.notNull(this._endOrLength === null) || dart.notNull(this._endOr
Length >= length)) { | 259 if (dart.notNull(this._endOrLength === null) || dart.notNull(this._endOr
Length >= length)) { |
| 228 return length - this._start; | 260 return length - this._start; |
| 229 } | 261 } |
| 230 return this._endOrLength - this._start; | 262 return this._endOrLength - this._start; |
| 231 } | 263 } |
| 232 elementAt(index) { | 264 elementAt(index) { |
| 233 let realIndex = this._startIndex + index; | 265 let realIndex = this._startIndex + index; |
| 234 if (dart.notNull(index < 0) || dart.notNull(realIndex >= this._endIndex)
) { | 266 if (dart.notNull(index < 0) || dart.notNull(realIndex >= this._endIndex)
) { |
| 235 throw new core.RangeError.index(index, this, "index"); | 267 throw new core.RangeError.index(index, this, "index"); |
| 236 } | 268 } |
| 237 return this._iterable.elementAt(realIndex); | 269 return this._iterable.elementAt(realIndex); |
| 238 } | 270 } |
| 239 skip(count) { | 271 skip(count) { |
| 240 core.RangeError.checkNotNegative(count, "count"); | 272 core.RangeError.checkNotNegative(count, "count"); |
| 241 let newStart = this._start + count; | 273 let newStart = this._start + count; |
| 242 if (dart.notNull(this._endOrLength !== null) && dart.notNull(newStart >=
this._endOrLength)) { | 274 if (dart.notNull(this._endOrLength !== null) && dart.notNull(newStart >=
this._endOrLength)) { |
| 243 return new EmptyIterable(); | 275 return new EmptyIterable(); |
| 244 } | 276 } |
| 245 return new SubListIterable(this._iterable, newStart, this._endOrLength); | 277 return new SubListIterable(this._iterable, newStart, this._endOrLength); |
| 246 } | 278 } |
| 247 take(count) { | 279 take(count) { |
| 248 core.RangeError.checkNotNegative(count, "count"); | 280 core.RangeError.checkNotNegative(count, "count"); |
| 249 if (this._endOrLength === null) { | 281 if (this._endOrLength === null) { |
| 250 return new SubListIterable(this._iterable, this._start, this._start +
count); | 282 return new SubListIterable(this._iterable, this._start, this._start +
count); |
| 251 } else { | 283 } else { |
| 252 let newEnd = this._start + count; | 284 let newEnd = this._start + count; |
| 253 if (this._endOrLength < newEnd) return this; | 285 if (this._endOrLength < newEnd) |
| 286 return this; |
| 254 return new SubListIterable(this._iterable, this._start, newEnd); | 287 return new SubListIterable(this._iterable, this._start, newEnd); |
| 255 } | 288 } |
| 256 } | 289 } |
| 257 toList(opt$) { | 290 toList(opt$) { |
| 258 let growable = opt$.growable === undefined ? true : opt$.growable; | 291 let growable = opt$.growable === void 0 ? true : opt$.growable; |
| 259 let start = this._start; | 292 let start = this._start; |
| 260 let end = this._iterable.length; | 293 let end = this._iterable.length; |
| 261 if (dart.notNull(this._endOrLength !== null) && dart.notNull(this._endOr
Length < end)) end = this._endOrLength; | 294 if (dart.notNull(this._endOrLength !== null) && dart.notNull(this._endOr
Length < end)) |
| 295 end = this._endOrLength; |
| 262 let length = end - start; | 296 let length = end - start; |
| 263 if (length < 0) length = 0; | 297 if (length < 0) |
| 264 let result = growable ? (((_) => { | 298 length = 0; |
| 299 let result = growable ? ((_) => { |
| 265 _.length = length; | 300 _.length = length; |
| 266 return _; | 301 return _; |
| 267 }).bind(this)(new core.List())) : new core.List(length); | 302 }).bind(this)(new core.List()) : new core.List(length); |
| 268 for (let i = 0; i < length; i++) { | 303 for (let i = 0; i < length; i++) { |
| 269 result.set(i, this._iterable.elementAt(start + i)); | 304 result.set(i, this._iterable.elementAt(start + i)); |
| 270 if (this._iterable.length < end) throw new core.ConcurrentModification
Error(this); | 305 if (this._iterable.length < end) |
| 306 throw new core.ConcurrentModificationError(this); |
| 271 } | 307 } |
| 272 return dart.as(result, core.List$(E)); | 308 return dart.as(result, core.List$(E)); |
| 273 } | 309 } |
| 274 } | 310 } |
| 275 return SubListIterable; | 311 return SubListIterable; |
| 276 }); | 312 }); |
| 277 let SubListIterable = SubListIterable$(dynamic); | 313 let SubListIterable = SubListIterable$(dynamic); |
| 278 | |
| 279 let ListIterator$ = dart.generic(function(E) { | 314 let ListIterator$ = dart.generic(function(E) { |
| 280 class ListIterator extends dart.Object { | 315 class ListIterator extends dart.Object { |
| 281 ListIterator(iterable) { | 316 ListIterator(iterable) { |
| 282 this._iterable = iterable; | 317 this._iterable = iterable; |
| 283 this._length = iterable.length; | 318 this._length = iterable.length; |
| 284 this._index = 0; | 319 this._index = 0; |
| 285 this._current = dart.as(null, E); | 320 this._current = dart.as(null, E); |
| 286 } | 321 } |
| 287 get current() { return this._current; } | 322 get current() { |
| 323 return this._current; |
| 324 } |
| 288 moveNext() { | 325 moveNext() { |
| 289 let length = this._iterable.length; | 326 let length = this._iterable.length; |
| 290 if (this._length !== length) { | 327 if (this._length !== length) { |
| 291 throw new core.ConcurrentModificationError(this._iterable); | 328 throw new core.ConcurrentModificationError(this._iterable); |
| 292 } | 329 } |
| 293 if (this._index >= length) { | 330 if (this._index >= length) { |
| 294 this._current = dart.as(null, E); | 331 this._current = dart.as(null, E); |
| 295 return false; | 332 return false; |
| 296 } | 333 } |
| 297 this._current = this._iterable.elementAt(this._index); | 334 this._current = this._iterable.elementAt(this._index); |
| 298 this._index++; | 335 this._index++; |
| 299 return true; | 336 return true; |
| 300 } | 337 } |
| 301 } | 338 } |
| 302 return ListIterator; | 339 return ListIterator; |
| 303 }); | 340 }); |
| 304 let ListIterator = ListIterator$(dynamic); | 341 let ListIterator = ListIterator$(dynamic); |
| 305 | |
| 306 let MappedIterable$ = dart.generic(function(S, T) { | 342 let MappedIterable$ = dart.generic(function(S, T) { |
| 307 class MappedIterable extends collection.IterableBase$(T) { | 343 class MappedIterable extends collection.IterableBase$(T) { |
| 308 MappedIterable(iterable, function) { | 344 MappedIterable(iterable, function) { |
| 309 if (dart.is(iterable, EfficientLength)) { | 345 if (dart.is(iterable, EfficientLength)) { |
| 310 return new EfficientLengthMappedIterable(iterable, function); | 346 return new EfficientLengthMappedIterable(iterable, function); |
| 311 } | 347 } |
| 312 return new MappedIterable._(iterable, function); | 348 return new MappedIterable._(iterable, function); |
| 313 } | 349 } |
| 314 MappedIterable$_(_iterable, _f) { | 350 MappedIterable$_(_iterable, _f) { |
| 315 this._iterable = _iterable; | 351 this._iterable = _iterable; |
| 316 this._f = _f; | 352 this._f = _f; |
| 317 super.IterableBase(); | 353 super.IterableBase(); |
| 318 } | 354 } |
| 319 get iterator() { return new MappedIterator(this._iterable.iterator, this._
f); } | 355 get iterator() { |
| 320 get length() { return this._iterable.length; } | 356 return new MappedIterator(this._iterable.iterator, this._f); |
| 321 get isEmpty() { return this._iterable.isEmpty; } | 357 } |
| 322 get first() { return this._f(this._iterable.first); } | 358 get length() { |
| 323 get last() { return this._f(this._iterable.last); } | 359 return this._iterable.length; |
| 324 get single() { return this._f(this._iterable.single); } | 360 } |
| 325 elementAt(index) { return this._f(this._iterable.elementAt(index)); } | 361 get isEmpty() { |
| 362 return this._iterable.isEmpty; |
| 363 } |
| 364 get first() { |
| 365 return this._f(this._iterable.first); |
| 366 } |
| 367 get last() { |
| 368 return this._f(this._iterable.last); |
| 369 } |
| 370 get single() { |
| 371 return this._f(this._iterable.single); |
| 372 } |
| 373 elementAt(index) { |
| 374 return this._f(this._iterable.elementAt(index)); |
| 375 } |
| 326 } | 376 } |
| 327 dart.defineNamedConstructor(MappedIterable, "_"); | 377 dart.defineNamedConstructor(MappedIterable, '_'); |
| 328 return MappedIterable; | 378 return MappedIterable; |
| 329 }); | 379 }); |
| 330 let MappedIterable = MappedIterable$(dynamic, dynamic); | 380 let MappedIterable = MappedIterable$(dynamic, dynamic); |
| 331 | |
| 332 let EfficientLengthMappedIterable$ = dart.generic(function(S, T) { | 381 let EfficientLengthMappedIterable$ = dart.generic(function(S, T) { |
| 333 class EfficientLengthMappedIterable extends MappedIterable$(S, T) { | 382 class EfficientLengthMappedIterable extends MappedIterable$(S, T) { |
| 334 EfficientLengthMappedIterable(iterable, function) { | 383 EfficientLengthMappedIterable(iterable, function) { |
| 335 super.MappedIterable$_(dart.as(iterable, core.Iterable$(S)), function); | 384 super.MappedIterable$_(dart.as(iterable, core.Iterable$(S)), function); |
| 336 } | 385 } |
| 337 } | 386 } |
| 338 return EfficientLengthMappedIterable; | 387 return EfficientLengthMappedIterable; |
| 339 }); | 388 }); |
| 340 let EfficientLengthMappedIterable = EfficientLengthMappedIterable$(dynamic, dy
namic); | 389 let EfficientLengthMappedIterable = EfficientLengthMappedIterable$(dynamic, dy
namic); |
| 341 | |
| 342 let MappedIterator$ = dart.generic(function(S, T) { | 390 let MappedIterator$ = dart.generic(function(S, T) { |
| 343 class MappedIterator extends core.Iterator$(T) { | 391 class MappedIterator extends core.Iterator$(T) { |
| 344 MappedIterator(_iterator, _f) { | 392 MappedIterator(_iterator, _f) { |
| 345 this._iterator = _iterator; | 393 this._iterator = _iterator; |
| 346 this._f = _f; | 394 this._f = _f; |
| 347 this._current = dart.as(null, T); | 395 this._current = dart.as(null, T); |
| 348 super.Iterator(); | 396 super.Iterator(); |
| 349 } | 397 } |
| 350 moveNext() { | 398 moveNext() { |
| 351 if (this._iterator.moveNext()) { | 399 if (this._iterator.moveNext()) { |
| 352 this._current = this._f(this._iterator.current); | 400 this._current = this._f(this._iterator.current); |
| 353 return true; | 401 return true; |
| 354 } | 402 } |
| 355 this._current = dart.as(null, T); | 403 this._current = dart.as(null, T); |
| 356 return false; | 404 return false; |
| 357 } | 405 } |
| 358 get current() { return this._current; } | 406 get current() { |
| 407 return this._current; |
| 408 } |
| 359 } | 409 } |
| 360 return MappedIterator; | 410 return MappedIterator; |
| 361 }); | 411 }); |
| 362 let MappedIterator = MappedIterator$(dynamic, dynamic); | 412 let MappedIterator = MappedIterator$(dynamic, dynamic); |
| 363 | |
| 364 let MappedListIterable$ = dart.generic(function(S, T) { | 413 let MappedListIterable$ = dart.generic(function(S, T) { |
| 365 class MappedListIterable extends ListIterable$(T) { | 414 class MappedListIterable extends ListIterable$(T) { |
| 366 MappedListIterable(_source, _f) { | 415 MappedListIterable(_source, _f) { |
| 367 this._source = _source; | 416 this._source = _source; |
| 368 this._f = _f; | 417 this._f = _f; |
| 369 super.ListIterable(); | 418 super.ListIterable(); |
| 370 } | 419 } |
| 371 get length() { return this._source.length; } | 420 get length() { |
| 372 elementAt(index) { return this._f(this._source.elementAt(index)); } | 421 return this._source.length; |
| 422 } |
| 423 elementAt(index) { |
| 424 return this._f(this._source.elementAt(index)); |
| 425 } |
| 373 } | 426 } |
| 374 return MappedListIterable; | 427 return MappedListIterable; |
| 375 }); | 428 }); |
| 376 let MappedListIterable = MappedListIterable$(dynamic, dynamic); | 429 let MappedListIterable = MappedListIterable$(dynamic, dynamic); |
| 377 | |
| 378 let WhereIterable$ = dart.generic(function(E) { | 430 let WhereIterable$ = dart.generic(function(E) { |
| 379 class WhereIterable extends collection.IterableBase$(E) { | 431 class WhereIterable extends collection.IterableBase$(E) { |
| 380 WhereIterable(_iterable, _f) { | 432 WhereIterable(_iterable, _f) { |
| 381 this._iterable = _iterable; | 433 this._iterable = _iterable; |
| 382 this._f = _f; | 434 this._f = _f; |
| 383 super.IterableBase(); | 435 super.IterableBase(); |
| 384 } | 436 } |
| 385 get iterator() { return new WhereIterator(this._iterable.iterator, this._f
); } | 437 get iterator() { |
| 438 return new WhereIterator(this._iterable.iterator, this._f); |
| 439 } |
| 386 } | 440 } |
| 387 return WhereIterable; | 441 return WhereIterable; |
| 388 }); | 442 }); |
| 389 let WhereIterable = WhereIterable$(dynamic); | 443 let WhereIterable = WhereIterable$(dynamic); |
| 390 | |
| 391 let WhereIterator$ = dart.generic(function(E) { | 444 let WhereIterator$ = dart.generic(function(E) { |
| 392 class WhereIterator extends core.Iterator$(E) { | 445 class WhereIterator extends core.Iterator$(E) { |
| 393 WhereIterator(_iterator, _f) { | 446 WhereIterator(_iterator, _f) { |
| 394 this._iterator = _iterator; | 447 this._iterator = _iterator; |
| 395 this._f = _f; | 448 this._f = _f; |
| 396 super.Iterator(); | 449 super.Iterator(); |
| 397 } | 450 } |
| 398 moveNext() { | 451 moveNext() { |
| 399 while (this._iterator.moveNext()) { | 452 while (this._iterator.moveNext()) { |
| 400 if (this._f(this._iterator.current)) { | 453 if (this._f(this._iterator.current)) { |
| 401 return true; | 454 return true; |
| 402 } | 455 } |
| 403 } | 456 } |
| 404 return false; | 457 return false; |
| 405 } | 458 } |
| 406 get current() { return this._iterator.current; } | 459 get current() { |
| 460 return this._iterator.current; |
| 461 } |
| 407 } | 462 } |
| 408 return WhereIterator; | 463 return WhereIterator; |
| 409 }); | 464 }); |
| 410 let WhereIterator = WhereIterator$(dynamic); | 465 let WhereIterator = WhereIterator$(dynamic); |
| 411 | |
| 412 let ExpandIterable$ = dart.generic(function(S, T) { | 466 let ExpandIterable$ = dart.generic(function(S, T) { |
| 413 class ExpandIterable extends collection.IterableBase$(T) { | 467 class ExpandIterable extends collection.IterableBase$(T) { |
| 414 ExpandIterable(_iterable, _f) { | 468 ExpandIterable(_iterable, _f) { |
| 415 this._iterable = _iterable; | 469 this._iterable = _iterable; |
| 416 this._f = _f; | 470 this._f = _f; |
| 417 super.IterableBase(); | 471 super.IterableBase(); |
| 418 } | 472 } |
| 419 get iterator() { return new ExpandIterator(this._iterable.iterator, this._
f); } | 473 get iterator() { |
| 474 return new ExpandIterator(this._iterable.iterator, this._f); |
| 475 } |
| 420 } | 476 } |
| 421 return ExpandIterable; | 477 return ExpandIterable; |
| 422 }); | 478 }); |
| 423 let ExpandIterable = ExpandIterable$(dynamic, dynamic); | 479 let ExpandIterable = ExpandIterable$(dynamic, dynamic); |
| 424 | |
| 425 let ExpandIterator$ = dart.generic(function(S, T) { | 480 let ExpandIterator$ = dart.generic(function(S, T) { |
| 426 class ExpandIterator extends dart.Object { | 481 class ExpandIterator extends dart.Object { |
| 427 ExpandIterator(_iterator, _f) { | 482 ExpandIterator(_iterator, _f) { |
| 428 this._iterator = _iterator; | 483 this._iterator = _iterator; |
| 429 this._f = _f; | 484 this._f = _f; |
| 430 this._currentExpansion = dart.as(new EmptyIterator(), core.Iterator$(T))
; | 485 this._currentExpansion = dart.as(new EmptyIterator(), core.Iterator$(T))
; |
| 431 this._current = dart.as(null, T); | 486 this._current = dart.as(null, T); |
| 432 } | 487 } |
| 433 _nextExpansion() { | 488 _nextExpansion() {} |
| 489 get current() { |
| 490 return this._current; |
| 434 } | 491 } |
| 435 get current() { return this._current; } | |
| 436 moveNext() { | 492 moveNext() { |
| 437 if (this._currentExpansion === null) return false; | 493 if (this._currentExpansion === null) |
| 494 return false; |
| 438 while (!dart.notNull(this._currentExpansion.moveNext())) { | 495 while (!dart.notNull(this._currentExpansion.moveNext())) { |
| 439 this._current = dart.as(null, T); | 496 this._current = dart.as(null, T); |
| 440 if (this._iterator.moveNext()) { | 497 if (this._iterator.moveNext()) { |
| 441 this._currentExpansion = null; | 498 this._currentExpansion = null; |
| 442 this._currentExpansion = dart.as(this._f(this._iterator.current).ite
rator, core.Iterator$(T)); | 499 this._currentExpansion = dart.as(this._f(this._iterator.current).ite
rator, core.Iterator$(T)); |
| 443 } else { | 500 } else { |
| 444 return false; | 501 return false; |
| 445 } | 502 } |
| 446 } | 503 } |
| 447 this._current = this._currentExpansion.current; | 504 this._current = this._currentExpansion.current; |
| 448 return true; | 505 return true; |
| 449 } | 506 } |
| 450 } | 507 } |
| 451 return ExpandIterator; | 508 return ExpandIterator; |
| 452 }); | 509 }); |
| 453 let ExpandIterator = ExpandIterator$(dynamic, dynamic); | 510 let ExpandIterator = ExpandIterator$(dynamic, dynamic); |
| 454 | |
| 455 let TakeIterable$ = dart.generic(function(E) { | 511 let TakeIterable$ = dart.generic(function(E) { |
| 456 class TakeIterable extends collection.IterableBase$(E) { | 512 class TakeIterable extends collection.IterableBase$(E) { |
| 457 TakeIterable(iterable, takeCount) { | 513 TakeIterable(iterable, takeCount) { |
| 458 if (dart.notNull(!(typeof takeCount == "number")) || dart.notNull(takeCo
unt < 0)) { | 514 if (dart.notNull(!(typeof takeCount == number)) || dart.notNull(takeCoun
t < 0)) { |
| 459 throw new core.ArgumentError(takeCount); | 515 throw new core.ArgumentError(takeCount); |
| 460 } | 516 } |
| 461 if (dart.is(iterable, EfficientLength)) { | 517 if (dart.is(iterable, EfficientLength)) { |
| 462 return new EfficientLengthTakeIterable(iterable, takeCount); | 518 return new EfficientLengthTakeIterable(iterable, takeCount); |
| 463 } | 519 } |
| 464 return new TakeIterable._(iterable, takeCount); | 520 return new TakeIterable._(iterable, takeCount); |
| 465 } | 521 } |
| 466 TakeIterable$_(_iterable, _takeCount) { | 522 TakeIterable$_(_iterable, _takeCount) { |
| 467 this._iterable = _iterable; | 523 this._iterable = _iterable; |
| 468 this._takeCount = _takeCount; | 524 this._takeCount = _takeCount; |
| 469 super.IterableBase(); | 525 super.IterableBase(); |
| 470 } | 526 } |
| 471 get iterator() { | 527 get iterator() { |
| 472 return new TakeIterator(this._iterable.iterator, this._takeCount); | 528 return new TakeIterator(this._iterable.iterator, this._takeCount); |
| 473 } | 529 } |
| 474 } | 530 } |
| 475 dart.defineNamedConstructor(TakeIterable, "_"); | 531 dart.defineNamedConstructor(TakeIterable, '_'); |
| 476 return TakeIterable; | 532 return TakeIterable; |
| 477 }); | 533 }); |
| 478 let TakeIterable = TakeIterable$(dynamic); | 534 let TakeIterable = TakeIterable$(dynamic); |
| 479 | |
| 480 let EfficientLengthTakeIterable$ = dart.generic(function(E) { | 535 let EfficientLengthTakeIterable$ = dart.generic(function(E) { |
| 481 class EfficientLengthTakeIterable extends TakeIterable$(E) { | 536 class EfficientLengthTakeIterable extends TakeIterable$(E) { |
| 482 EfficientLengthTakeIterable(iterable, takeCount) { | 537 EfficientLengthTakeIterable(iterable, takeCount) { |
| 483 super.TakeIterable$_(iterable, takeCount); | 538 super.TakeIterable$_(iterable, takeCount); |
| 484 } | 539 } |
| 485 get length() { | 540 get length() { |
| 486 let iterableLength = this._iterable.length; | 541 let iterableLength = this._iterable.length; |
| 487 if (iterableLength > this._takeCount) return this._takeCount; | 542 if (iterableLength > this._takeCount) |
| 543 return this._takeCount; |
| 488 return iterableLength; | 544 return iterableLength; |
| 489 } | 545 } |
| 490 } | 546 } |
| 491 return EfficientLengthTakeIterable; | 547 return EfficientLengthTakeIterable; |
| 492 }); | 548 }); |
| 493 let EfficientLengthTakeIterable = EfficientLengthTakeIterable$(dynamic); | 549 let EfficientLengthTakeIterable = EfficientLengthTakeIterable$(dynamic); |
| 494 | |
| 495 let TakeIterator$ = dart.generic(function(E) { | 550 let TakeIterator$ = dart.generic(function(E) { |
| 496 class TakeIterator extends core.Iterator$(E) { | 551 class TakeIterator extends core.Iterator$(E) { |
| 497 TakeIterator(_iterator, _remaining) { | 552 TakeIterator(_iterator, _remaining) { |
| 498 this._iterator = _iterator; | 553 this._iterator = _iterator; |
| 499 this._remaining = _remaining; | 554 this._remaining = _remaining; |
| 500 super.Iterator(); | 555 super.Iterator(); |
| 501 dart.assert(dart.notNull(typeof this._remaining == "number") && dart.not
Null(this._remaining >= 0)); | 556 dart.assert(dart.notNull(typeof this._remaining == number) && dart.notNu
ll(this._remaining >= 0)); |
| 502 } | 557 } |
| 503 moveNext() { | 558 moveNext() { |
| 504 this._remaining--; | 559 this._remaining--; |
| 505 if (this._remaining >= 0) { | 560 if (this._remaining >= 0) { |
| 506 return this._iterator.moveNext(); | 561 return this._iterator.moveNext(); |
| 507 } | 562 } |
| 508 this._remaining = -1; | 563 this._remaining = -1; |
| 509 return false; | 564 return false; |
| 510 } | 565 } |
| 511 get current() { | 566 get current() { |
| 512 if (this._remaining < 0) return dart.as(null, E); | 567 if (this._remaining < 0) |
| 568 return dart.as(null, E); |
| 513 return this._iterator.current; | 569 return this._iterator.current; |
| 514 } | 570 } |
| 515 } | 571 } |
| 516 return TakeIterator; | 572 return TakeIterator; |
| 517 }); | 573 }); |
| 518 let TakeIterator = TakeIterator$(dynamic); | 574 let TakeIterator = TakeIterator$(dynamic); |
| 519 | |
| 520 let TakeWhileIterable$ = dart.generic(function(E) { | 575 let TakeWhileIterable$ = dart.generic(function(E) { |
| 521 class TakeWhileIterable extends collection.IterableBase$(E) { | 576 class TakeWhileIterable extends collection.IterableBase$(E) { |
| 522 TakeWhileIterable(_iterable, _f) { | 577 TakeWhileIterable(_iterable, _f) { |
| 523 this._iterable = _iterable; | 578 this._iterable = _iterable; |
| 524 this._f = _f; | 579 this._f = _f; |
| 525 super.IterableBase(); | 580 super.IterableBase(); |
| 526 } | 581 } |
| 527 get iterator() { | 582 get iterator() { |
| 528 return new TakeWhileIterator(this._iterable.iterator, this._f); | 583 return new TakeWhileIterator(this._iterable.iterator, this._f); |
| 529 } | 584 } |
| 530 } | 585 } |
| 531 return TakeWhileIterable; | 586 return TakeWhileIterable; |
| 532 }); | 587 }); |
| 533 let TakeWhileIterable = TakeWhileIterable$(dynamic); | 588 let TakeWhileIterable = TakeWhileIterable$(dynamic); |
| 534 | |
| 535 let TakeWhileIterator$ = dart.generic(function(E) { | 589 let TakeWhileIterator$ = dart.generic(function(E) { |
| 536 class TakeWhileIterator extends core.Iterator$(E) { | 590 class TakeWhileIterator extends core.Iterator$(E) { |
| 537 TakeWhileIterator(_iterator, _f) { | 591 TakeWhileIterator(_iterator, _f) { |
| 538 this._iterator = _iterator; | 592 this._iterator = _iterator; |
| 539 this._f = _f; | 593 this._f = _f; |
| 540 this._isFinished = false; | 594 this._isFinished = false; |
| 541 super.Iterator(); | 595 super.Iterator(); |
| 542 } | 596 } |
| 543 moveNext() { | 597 moveNext() { |
| 544 if (this._isFinished) return false; | 598 if (this._isFinished) |
| 599 return false; |
| 545 if (dart.notNull(!dart.notNull(this._iterator.moveNext())) || dart.notNu
ll(!dart.notNull(this._f(this._iterator.current)))) { | 600 if (dart.notNull(!dart.notNull(this._iterator.moveNext())) || dart.notNu
ll(!dart.notNull(this._f(this._iterator.current)))) { |
| 546 this._isFinished = true; | 601 this._isFinished = true; |
| 547 return false; | 602 return false; |
| 548 } | 603 } |
| 549 return true; | 604 return true; |
| 550 } | 605 } |
| 551 get current() { | 606 get current() { |
| 552 if (this._isFinished) return dart.as(null, E); | 607 if (this._isFinished) |
| 608 return dart.as(null, E); |
| 553 return this._iterator.current; | 609 return this._iterator.current; |
| 554 } | 610 } |
| 555 } | 611 } |
| 556 return TakeWhileIterator; | 612 return TakeWhileIterator; |
| 557 }); | 613 }); |
| 558 let TakeWhileIterator = TakeWhileIterator$(dynamic); | 614 let TakeWhileIterator = TakeWhileIterator$(dynamic); |
| 559 | |
| 560 let SkipIterable$ = dart.generic(function(E) { | 615 let SkipIterable$ = dart.generic(function(E) { |
| 561 class SkipIterable extends collection.IterableBase$(E) { | 616 class SkipIterable extends collection.IterableBase$(E) { |
| 562 SkipIterable(iterable, count) { | 617 SkipIterable(iterable, count) { |
| 563 if (dart.is(iterable, EfficientLength)) { | 618 if (dart.is(iterable, EfficientLength)) { |
| 564 return new EfficientLengthSkipIterable(iterable, count); | 619 return new EfficientLengthSkipIterable(iterable, count); |
| 565 } | 620 } |
| 566 return new SkipIterable._(iterable, count); | 621 return new SkipIterable._(iterable, count); |
| 567 } | 622 } |
| 568 SkipIterable$_(_iterable, _skipCount) { | 623 SkipIterable$_(_iterable, _skipCount) { |
| 569 this._iterable = _iterable; | 624 this._iterable = _iterable; |
| 570 this._skipCount = _skipCount; | 625 this._skipCount = _skipCount; |
| 571 super.IterableBase(); | 626 super.IterableBase(); |
| 572 if (!(typeof this._skipCount == "number")) { | 627 if (!(typeof this._skipCount == number)) { |
| 573 throw new core.ArgumentError.value(this._skipCount, "count is not an i
nteger"); | 628 throw new core.ArgumentError.value(this._skipCount, "count is not an i
nteger"); |
| 574 } | 629 } |
| 575 core.RangeError.checkNotNegative(this._skipCount, "count"); | 630 core.RangeError.checkNotNegative(this._skipCount, "count"); |
| 576 } | 631 } |
| 577 skip(count) { | 632 skip(count) { |
| 578 if (!(typeof this._skipCount == "number")) { | 633 if (!(typeof this._skipCount == number)) { |
| 579 throw new core.ArgumentError.value(this._skipCount, "count is not an i
nteger"); | 634 throw new core.ArgumentError.value(this._skipCount, "count is not an i
nteger"); |
| 580 } | 635 } |
| 581 core.RangeError.checkNotNegative(this._skipCount, "count"); | 636 core.RangeError.checkNotNegative(this._skipCount, "count"); |
| 582 return new SkipIterable._(this._iterable, this._skipCount + count); | 637 return new SkipIterable._(this._iterable, this._skipCount + count); |
| 583 } | 638 } |
| 584 get iterator() { | 639 get iterator() { |
| 585 return new SkipIterator(this._iterable.iterator, this._skipCount); | 640 return new SkipIterator(this._iterable.iterator, this._skipCount); |
| 586 } | 641 } |
| 587 } | 642 } |
| 588 dart.defineNamedConstructor(SkipIterable, "_"); | 643 dart.defineNamedConstructor(SkipIterable, '_'); |
| 589 return SkipIterable; | 644 return SkipIterable; |
| 590 }); | 645 }); |
| 591 let SkipIterable = SkipIterable$(dynamic); | 646 let SkipIterable = SkipIterable$(dynamic); |
| 592 | |
| 593 let EfficientLengthSkipIterable$ = dart.generic(function(E) { | 647 let EfficientLengthSkipIterable$ = dart.generic(function(E) { |
| 594 class EfficientLengthSkipIterable extends SkipIterable$(E) { | 648 class EfficientLengthSkipIterable extends SkipIterable$(E) { |
| 595 EfficientLengthSkipIterable(iterable, skipCount) { | 649 EfficientLengthSkipIterable(iterable, skipCount) { |
| 596 super.SkipIterable$_(iterable, skipCount); | 650 super.SkipIterable$_(iterable, skipCount); |
| 597 } | 651 } |
| 598 get length() { | 652 get length() { |
| 599 let length = this._iterable.length - this._skipCount; | 653 let length = this._iterable.length - this._skipCount; |
| 600 if (length >= 0) return length; | 654 if (length >= 0) |
| 655 return length; |
| 601 return 0; | 656 return 0; |
| 602 } | 657 } |
| 603 } | 658 } |
| 604 return EfficientLengthSkipIterable; | 659 return EfficientLengthSkipIterable; |
| 605 }); | 660 }); |
| 606 let EfficientLengthSkipIterable = EfficientLengthSkipIterable$(dynamic); | 661 let EfficientLengthSkipIterable = EfficientLengthSkipIterable$(dynamic); |
| 607 | |
| 608 let SkipIterator$ = dart.generic(function(E) { | 662 let SkipIterator$ = dart.generic(function(E) { |
| 609 class SkipIterator extends core.Iterator$(E) { | 663 class SkipIterator extends core.Iterator$(E) { |
| 610 SkipIterator(_iterator, _skipCount) { | 664 SkipIterator(_iterator, _skipCount) { |
| 611 this._iterator = _iterator; | 665 this._iterator = _iterator; |
| 612 this._skipCount = _skipCount; | 666 this._skipCount = _skipCount; |
| 613 super.Iterator(); | 667 super.Iterator(); |
| 614 dart.assert(dart.notNull(typeof this._skipCount == "number") && dart.not
Null(this._skipCount >= 0)); | 668 dart.assert(dart.notNull(typeof this._skipCount == number) && dart.notNu
ll(this._skipCount >= 0)); |
| 615 } | 669 } |
| 616 moveNext() { | 670 moveNext() { |
| 617 for (let i = 0; i < this._skipCount; i++) this._iterator.moveNext(); | 671 for (let i = 0; i < this._skipCount; i++) |
| 672 this._iterator.moveNext(); |
| 618 this._skipCount = 0; | 673 this._skipCount = 0; |
| 619 return this._iterator.moveNext(); | 674 return this._iterator.moveNext(); |
| 620 } | 675 } |
| 621 get current() { return this._iterator.current; } | 676 get current() { |
| 677 return this._iterator.current; |
| 678 } |
| 622 } | 679 } |
| 623 return SkipIterator; | 680 return SkipIterator; |
| 624 }); | 681 }); |
| 625 let SkipIterator = SkipIterator$(dynamic); | 682 let SkipIterator = SkipIterator$(dynamic); |
| 626 | |
| 627 let SkipWhileIterable$ = dart.generic(function(E) { | 683 let SkipWhileIterable$ = dart.generic(function(E) { |
| 628 class SkipWhileIterable extends collection.IterableBase$(E) { | 684 class SkipWhileIterable extends collection.IterableBase$(E) { |
| 629 SkipWhileIterable(_iterable, _f) { | 685 SkipWhileIterable(_iterable, _f) { |
| 630 this._iterable = _iterable; | 686 this._iterable = _iterable; |
| 631 this._f = _f; | 687 this._f = _f; |
| 632 super.IterableBase(); | 688 super.IterableBase(); |
| 633 } | 689 } |
| 634 get iterator() { | 690 get iterator() { |
| 635 return new SkipWhileIterator(this._iterable.iterator, this._f); | 691 return new SkipWhileIterator(this._iterable.iterator, this._f); |
| 636 } | 692 } |
| 637 } | 693 } |
| 638 return SkipWhileIterable; | 694 return SkipWhileIterable; |
| 639 }); | 695 }); |
| 640 let SkipWhileIterable = SkipWhileIterable$(dynamic); | 696 let SkipWhileIterable = SkipWhileIterable$(dynamic); |
| 641 | |
| 642 let SkipWhileIterator$ = dart.generic(function(E) { | 697 let SkipWhileIterator$ = dart.generic(function(E) { |
| 643 class SkipWhileIterator extends core.Iterator$(E) { | 698 class SkipWhileIterator extends core.Iterator$(E) { |
| 644 SkipWhileIterator(_iterator, _f) { | 699 SkipWhileIterator(_iterator, _f) { |
| 645 this._iterator = _iterator; | 700 this._iterator = _iterator; |
| 646 this._f = _f; | 701 this._f = _f; |
| 647 this._hasSkipped = false; | 702 this._hasSkipped = false; |
| 648 super.Iterator(); | 703 super.Iterator(); |
| 649 } | 704 } |
| 650 moveNext() { | 705 moveNext() { |
| 651 if (!dart.notNull(this._hasSkipped)) { | 706 if (!dart.notNull(this._hasSkipped)) { |
| 652 this._hasSkipped = true; | 707 this._hasSkipped = true; |
| 653 while (this._iterator.moveNext()) { | 708 while (this._iterator.moveNext()) { |
| 654 if (!dart.notNull(this._f(this._iterator.current))) return true; | 709 if (!dart.notNull(this._f(this._iterator.current))) |
| 710 return true; |
| 655 } | 711 } |
| 656 } | 712 } |
| 657 return this._iterator.moveNext(); | 713 return this._iterator.moveNext(); |
| 658 } | 714 } |
| 659 get current() { return this._iterator.current; } | 715 get current() { |
| 716 return this._iterator.current; |
| 717 } |
| 660 } | 718 } |
| 661 return SkipWhileIterator; | 719 return SkipWhileIterator; |
| 662 }); | 720 }); |
| 663 let SkipWhileIterator = SkipWhileIterator$(dynamic); | 721 let SkipWhileIterator = SkipWhileIterator$(dynamic); |
| 664 | |
| 665 let EmptyIterable$ = dart.generic(function(E) { | 722 let EmptyIterable$ = dart.generic(function(E) { |
| 666 class EmptyIterable extends collection.IterableBase$(E) { | 723 class EmptyIterable extends collection.IterableBase$(E) { |
| 667 EmptyIterable() { | 724 EmptyIterable() { |
| 668 super.IterableBase(); | 725 super.IterableBase(); |
| 669 } | 726 } |
| 670 get iterator() { return dart.as(new EmptyIterator(), core.Iterator$(E)); } | 727 get iterator() { |
| 671 forEach(action) { | 728 return dart.as(new EmptyIterator(), core.Iterator$(E)); |
| 672 } | 729 } |
| 673 get isEmpty() { return true; } | 730 forEach(action) {} |
| 674 get length() { return 0; } | 731 get isEmpty() { |
| 732 return true; |
| 733 } |
| 734 get length() { |
| 735 return 0; |
| 736 } |
| 675 get first() { | 737 get first() { |
| 676 throw IterableElementError.noElement(); | 738 throw IterableElementError.noElement(); |
| 677 } | 739 } |
| 678 get last() { | 740 get last() { |
| 679 throw IterableElementError.noElement(); | 741 throw IterableElementError.noElement(); |
| 680 } | 742 } |
| 681 get single() { | 743 get single() { |
| 682 throw IterableElementError.noElement(); | 744 throw IterableElementError.noElement(); |
| 683 } | 745 } |
| 684 elementAt(index) { | 746 elementAt(index) { |
| 685 throw new core.RangeError.range(index, 0, 0, "index"); | 747 throw new core.RangeError.range(index, 0, 0, "index"); |
| 686 } | 748 } |
| 687 contains(element) { return false; } | 749 contains(element) { |
| 688 every(test) { return true; } | 750 return false; |
| 689 any(test) { return false; } | 751 } |
| 752 every(test) { |
| 753 return true; |
| 754 } |
| 755 any(test) { |
| 756 return false; |
| 757 } |
| 690 firstWhere(test, opt$) { | 758 firstWhere(test, opt$) { |
| 691 let orElse = opt$.orElse === undefined ? null : opt$.orElse; | 759 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 692 if (orElse !== null) return orElse(); | 760 if (orElse !== null) |
| 761 return orElse(); |
| 693 throw IterableElementError.noElement(); | 762 throw IterableElementError.noElement(); |
| 694 } | 763 } |
| 695 lastWhere(test, opt$) { | 764 lastWhere(test, opt$) { |
| 696 let orElse = opt$.orElse === undefined ? null : opt$.orElse; | 765 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 697 if (orElse !== null) return orElse(); | 766 if (orElse !== null) |
| 767 return orElse(); |
| 698 throw IterableElementError.noElement(); | 768 throw IterableElementError.noElement(); |
| 699 } | 769 } |
| 700 singleWhere(test, opt$) { | 770 singleWhere(test, opt$) { |
| 701 let orElse = opt$.orElse === undefined ? null : opt$.orElse; | 771 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 702 if (orElse !== null) return orElse(); | 772 if (orElse !== null) |
| 773 return orElse(); |
| 703 throw IterableElementError.noElement(); | 774 throw IterableElementError.noElement(); |
| 704 } | 775 } |
| 705 join(separator) { | 776 join(separator) { |
| 706 if (separator === undefined) separator = ""; | 777 if (separator === void 0) |
| 707 return "" | 778 separator = ""; |
| 779 return ""; |
| 708 } | 780 } |
| 709 where(test) { return this; } | 781 where(test) { |
| 710 map(f) { return new EmptyIterable(); } | 782 return this; |
| 783 } |
| 784 map(f) { |
| 785 return new EmptyIterable(); |
| 786 } |
| 711 reduce(combine) { | 787 reduce(combine) { |
| 712 throw IterableElementError.noElement(); | 788 throw IterableElementError.noElement(); |
| 713 } | 789 } |
| 714 fold(initialValue, combine) { | 790 fold(initialValue, combine) { |
| 715 return initialValue; | 791 return initialValue; |
| 716 } | 792 } |
| 717 skip(count) { | 793 skip(count) { |
| 718 core.RangeError.checkNotNegative(count, "count"); | 794 core.RangeError.checkNotNegative(count, "count"); |
| 719 return this; | 795 return this; |
| 720 } | 796 } |
| 721 skipWhile(test) { return this; } | 797 skipWhile(test) { |
| 798 return this; |
| 799 } |
| 722 take(count) { | 800 take(count) { |
| 723 core.RangeError.checkNotNegative(count, "count"); | 801 core.RangeError.checkNotNegative(count, "count"); |
| 724 return this; | 802 return this; |
| 725 } | 803 } |
| 726 takeWhile(test) { return this; } | 804 takeWhile(test) { |
| 805 return this; |
| 806 } |
| 727 toList(opt$) { | 807 toList(opt$) { |
| 728 let growable = opt$.growable === undefined ? true : opt$.growable; | 808 let growable = opt$.growable === void 0 ? true : opt$.growable; |
| 729 return growable ? new List.from([]) : new core.List(0) | 809 return growable ? new List.from([]) : new core.List(0); |
| 730 } | 810 } |
| 731 toSet() { return new core.Set(); } | 811 toSet() { |
| 812 return new core.Set(); |
| 813 } |
| 732 } | 814 } |
| 733 return EmptyIterable; | 815 return EmptyIterable; |
| 734 }); | 816 }); |
| 735 let EmptyIterable = EmptyIterable$(dynamic); | 817 let EmptyIterable = EmptyIterable$(dynamic); |
| 736 | |
| 737 let EmptyIterator$ = dart.generic(function(E) { | 818 let EmptyIterator$ = dart.generic(function(E) { |
| 738 class EmptyIterator extends dart.Object { | 819 class EmptyIterator extends dart.Object { |
| 739 EmptyIterator() { | 820 EmptyIterator() { |
| 740 } | 821 } |
| 741 moveNext() { return false; } | 822 moveNext() { |
| 742 get current() { return dart.as(null, E); } | 823 return false; |
| 824 } |
| 825 get current() { |
| 826 return dart.as(null, E); |
| 827 } |
| 743 } | 828 } |
| 744 return EmptyIterator; | 829 return EmptyIterator; |
| 745 }); | 830 }); |
| 746 let EmptyIterator = EmptyIterator$(dynamic); | 831 let EmptyIterator = EmptyIterator$(dynamic); |
| 747 | |
| 748 let BidirectionalIterator$ = dart.generic(function(T) { | 832 let BidirectionalIterator$ = dart.generic(function(T) { |
| 749 class BidirectionalIterator extends dart.Object { | 833 class BidirectionalIterator extends dart.Object { |
| 750 } | 834 } |
| 751 return BidirectionalIterator; | 835 return BidirectionalIterator; |
| 752 }); | 836 }); |
| 753 let BidirectionalIterator = BidirectionalIterator$(dynamic); | 837 let BidirectionalIterator = BidirectionalIterator$(dynamic); |
| 754 | |
| 755 let IterableMixinWorkaround$ = dart.generic(function(T) { | 838 let IterableMixinWorkaround$ = dart.generic(function(T) { |
| 756 class IterableMixinWorkaround extends dart.Object { | 839 class IterableMixinWorkaround extends dart.Object { |
| 757 static contains(iterable, element) { | 840 static contains(iterable, element) { |
| 758 for (let e of iterable) { | 841 for (let e of iterable) { |
| 759 if (dart.equals(e, element)) return true; | 842 if (dart.equals(e, element)) |
| 843 return true; |
| 760 } | 844 } |
| 761 return false; | 845 return false; |
| 762 } | 846 } |
| 763 static forEach(iterable, f) { | 847 static forEach(iterable, f) { |
| 764 for (let e of iterable) { | 848 for (let e of iterable) { |
| 765 f(e); | 849 f(e); |
| 766 } | 850 } |
| 767 } | 851 } |
| 768 static any(iterable, f) { | 852 static any(iterable, f) { |
| 769 for (let e of iterable) { | 853 for (let e of iterable) { |
| 770 if (f(e)) return true; | 854 if (f(e)) |
| 855 return true; |
| 771 } | 856 } |
| 772 return false; | 857 return false; |
| 773 } | 858 } |
| 774 static every(iterable, f) { | 859 static every(iterable, f) { |
| 775 for (let e of iterable) { | 860 for (let e of iterable) { |
| 776 if (!dart.notNull(f(e))) return false; | 861 if (!dart.notNull(f(e))) |
| 862 return false; |
| 777 } | 863 } |
| 778 return true; | 864 return true; |
| 779 } | 865 } |
| 780 static reduce(iterable, combine) { | 866 static reduce(iterable, combine) { |
| 781 let iterator = iterable.iterator; | 867 let iterator = iterable.iterator; |
| 782 if (!dart.notNull(iterator.moveNext())) throw IterableElementError.noEle
ment(); | 868 if (!dart.notNull(iterator.moveNext())) |
| 869 throw IterableElementError.noElement(); |
| 783 let value = iterator.current; | 870 let value = iterator.current; |
| 784 while (iterator.moveNext()) { | 871 while (iterator.moveNext()) { |
| 785 value = combine(value, iterator.current); | 872 value = combine(value, iterator.current); |
| 786 } | 873 } |
| 787 return value; | 874 return value; |
| 788 } | 875 } |
| 789 static fold(iterable, initialValue, combine) { | 876 static fold(iterable, initialValue, combine) { |
| 790 for (let element of iterable) { | 877 for (let element of iterable) { |
| 791 initialValue = combine(initialValue, element); | 878 initialValue = combine(initialValue, element); |
| 792 } | 879 } |
| 793 return initialValue; | 880 return initialValue; |
| 794 } | 881 } |
| 795 static removeWhereList(list, test) { | 882 static removeWhereList(list, test) { |
| 796 let retained = new List.from([]); | 883 let retained = new List.from([]); |
| 797 let length = list.length; | 884 let length = list.length; |
| 798 for (let i = 0; i < length; i++) { | 885 for (let i = 0; i < length; i++) { |
| 799 let element = list.get(i); | 886 let element = list.get(i); |
| 800 if (!dart.notNull(test(element))) { | 887 if (!dart.notNull(test(element))) { |
| 801 retained.add(element); | 888 retained.add(element); |
| 802 } | 889 } |
| 803 if (length !== list.length) { | 890 if (length !== list.length) { |
| 804 throw new core.ConcurrentModificationError(list); | 891 throw new core.ConcurrentModificationError(list); |
| 805 } | 892 } |
| 806 } | 893 } |
| 807 if (retained.length === length) return; | 894 if (retained.length === length) |
| 895 return; |
| 808 list.length = retained.length; | 896 list.length = retained.length; |
| 809 for (let i = 0; i < retained.length; i++) { | 897 for (let i = 0; i < retained.length; i++) { |
| 810 list.set(i, retained.get(i)); | 898 list.set(i, retained.get(i)); |
| 811 } | 899 } |
| 812 } | 900 } |
| 813 static isEmpty(iterable) { | 901 static isEmpty(iterable) { |
| 814 return !dart.notNull(iterable.iterator.moveNext()); | 902 return !dart.notNull(iterable.iterator.moveNext()); |
| 815 } | 903 } |
| 816 static first(iterable) { | 904 static first(iterable) { |
| 817 let it = iterable.iterator; | 905 let it = iterable.iterator; |
| 818 if (!dart.notNull(it.moveNext())) { | 906 if (!dart.notNull(it.moveNext())) { |
| 819 throw IterableElementError.noElement(); | 907 throw IterableElementError.noElement(); |
| 820 } | 908 } |
| 821 return it.current; | 909 return it.current; |
| 822 } | 910 } |
| 823 static last(iterable) { | 911 static last(iterable) { |
| 824 let it = iterable.iterator; | 912 let it = iterable.iterator; |
| 825 if (!dart.notNull(it.moveNext())) { | 913 if (!dart.notNull(it.moveNext())) { |
| 826 throw IterableElementError.noElement(); | 914 throw IterableElementError.noElement(); |
| 827 } | 915 } |
| 828 let result = null; | 916 let result = null; |
| 829 do { | 917 do { |
| 830 result = it.current; | 918 result = it.current; |
| 831 } | 919 } while (it.moveNext()); |
| 832 while (it.moveNext()); | |
| 833 return result; | 920 return result; |
| 834 } | 921 } |
| 835 static single(iterable) { | 922 static single(iterable) { |
| 836 let it = iterable.iterator; | 923 let it = iterable.iterator; |
| 837 if (!dart.notNull(it.moveNext())) throw IterableElementError.noElement()
; | 924 if (!dart.notNull(it.moveNext())) |
| 925 throw IterableElementError.noElement(); |
| 838 let result = it.current; | 926 let result = it.current; |
| 839 if (it.moveNext()) throw IterableElementError.tooMany(); | 927 if (it.moveNext()) |
| 928 throw IterableElementError.tooMany(); |
| 840 return result; | 929 return result; |
| 841 } | 930 } |
| 842 static firstWhere(iterable, test, orElse) { | 931 static firstWhere(iterable, test, orElse) { |
| 843 for (let element of iterable) { | 932 for (let element of iterable) { |
| 844 if (test(element)) return element; | 933 if (test(element)) |
| 934 return element; |
| 845 } | 935 } |
| 846 if (orElse !== null) return orElse(); | 936 if (orElse !== null) |
| 937 return orElse(); |
| 847 throw IterableElementError.noElement(); | 938 throw IterableElementError.noElement(); |
| 848 } | 939 } |
| 849 static lastWhere(iterable, test, orElse) { | 940 static lastWhere(iterable, test, orElse) { |
| 850 let result = null; | 941 let result = null; |
| 851 let foundMatching = false; | 942 let foundMatching = false; |
| 852 for (let element of iterable) { | 943 for (let element of iterable) { |
| 853 if (test(element)) { | 944 if (test(element)) { |
| 854 result = element; | 945 result = element; |
| 855 foundMatching = true; | 946 foundMatching = true; |
| 856 } | 947 } |
| 857 } | 948 } |
| 858 if (foundMatching) return result; | 949 if (foundMatching) |
| 859 if (orElse !== null) return orElse(); | 950 return result; |
| 951 if (orElse !== null) |
| 952 return orElse(); |
| 860 throw IterableElementError.noElement(); | 953 throw IterableElementError.noElement(); |
| 861 } | 954 } |
| 862 static lastWhereList(list, test, orElse) { | 955 static lastWhereList(list, test, orElse) { |
| 863 for (let i = list.length - 1; i >= 0; i--) { | 956 for (let i = list.length - 1; i >= 0; i--) { |
| 864 let element = list.get(i); | 957 let element = list.get(i); |
| 865 if (test(element)) return element; | 958 if (test(element)) |
| 959 return element; |
| 866 } | 960 } |
| 867 if (orElse !== null) return orElse(); | 961 if (orElse !== null) |
| 962 return orElse(); |
| 868 throw IterableElementError.noElement(); | 963 throw IterableElementError.noElement(); |
| 869 } | 964 } |
| 870 static singleWhere(iterable, test) { | 965 static singleWhere(iterable, test) { |
| 871 let result = null; | 966 let result = null; |
| 872 let foundMatching = false; | 967 let foundMatching = false; |
| 873 for (let element of iterable) { | 968 for (let element of iterable) { |
| 874 if (test(element)) { | 969 if (test(element)) { |
| 875 if (foundMatching) { | 970 if (foundMatching) { |
| 876 throw IterableElementError.tooMany(); | 971 throw IterableElementError.tooMany(); |
| 877 } | 972 } |
| 878 result = element; | 973 result = element; |
| 879 foundMatching = true; | 974 foundMatching = true; |
| 880 } | 975 } |
| 881 } | 976 } |
| 882 if (foundMatching) return result; | 977 if (foundMatching) |
| 978 return result; |
| 883 throw IterableElementError.noElement(); | 979 throw IterableElementError.noElement(); |
| 884 } | 980 } |
| 885 static elementAt(iterable, index) { | 981 static elementAt(iterable, index) { |
| 886 if (!(typeof index == "number")) throw new core.ArgumentError.notNull("i
ndex"); | 982 if (!(typeof index == number)) |
| 983 throw new core.ArgumentError.notNull("index"); |
| 887 core.RangeError.checkNotNegative(index, "index"); | 984 core.RangeError.checkNotNegative(index, "index"); |
| 888 let elementIndex = 0; | 985 let elementIndex = 0; |
| 889 for (let element of iterable) { | 986 for (let element of iterable) { |
| 890 if (index === elementIndex) return element; | 987 if (index === elementIndex) |
| 988 return element; |
| 891 elementIndex++; | 989 elementIndex++; |
| 892 } | 990 } |
| 893 throw new core.RangeError.index(index, iterable, "index", null, elementI
ndex); | 991 throw new core.RangeError.index(index, iterable, "index", null, elementI
ndex); |
| 894 } | 992 } |
| 895 static join(iterable, separator) { | 993 static join(iterable, separator) { |
| 896 if (separator === undefined) separator = null; | 994 if (separator === void 0) |
| 995 separator = null; |
| 897 let buffer = new core.StringBuffer(); | 996 let buffer = new core.StringBuffer(); |
| 898 buffer.writeAll(iterable, separator); | 997 buffer.writeAll(iterable, separator); |
| 899 return buffer.toString(); | 998 return buffer.toString(); |
| 900 } | 999 } |
| 901 static joinList(list, separator) { | 1000 static joinList(list, separator) { |
| 902 if (separator === undefined) separator = null; | 1001 if (separator === void 0) |
| 903 if (list.isEmpty) return ""; | 1002 separator = null; |
| 904 if (list.length === 1) return `${list.get(0)}`; | 1003 if (list.isEmpty) |
| 1004 return ""; |
| 1005 if (list.length === 1) |
| 1006 return `${list.get(0)}`; |
| 905 let buffer = new core.StringBuffer(); | 1007 let buffer = new core.StringBuffer(); |
| 906 if (separator.isEmpty) { | 1008 if (separator.isEmpty) { |
| 907 for (let i = 0; i < list.length; i++) { | 1009 for (let i = 0; i < list.length; i++) { |
| 908 buffer.write(list.get(i)); | 1010 buffer.write(list.get(i)); |
| 909 } | 1011 } |
| 910 } else { | 1012 } else { |
| 911 buffer.write(list.get(0)); | 1013 buffer.write(list.get(0)); |
| 912 for (let i = 1; i < list.length; i++) { | 1014 for (let i = 1; i < list.length; i++) { |
| 913 buffer.write(separator); | 1015 buffer.write(separator); |
| 914 buffer.write(list.get(i)); | 1016 buffer.write(list.get(i)); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 937 skipList(list, n) { | 1039 skipList(list, n) { |
| 938 return new SubListIterable(list, n, null); | 1040 return new SubListIterable(list, n, null); |
| 939 } | 1041 } |
| 940 skipWhile(iterable, test) { | 1042 skipWhile(iterable, test) { |
| 941 return new SkipWhileIterable(iterable, test); | 1043 return new SkipWhileIterable(iterable, test); |
| 942 } | 1044 } |
| 943 reversedList(list) { | 1045 reversedList(list) { |
| 944 return new ReversedListIterable(list); | 1046 return new ReversedListIterable(list); |
| 945 } | 1047 } |
| 946 static sortList(list, compare) { | 1048 static sortList(list, compare) { |
| 947 if (compare === null) compare = dart.as(core.Comparable.compare, /* Unim
plemented type (dynamic, dynamic) → int */); | 1049 if (compare === null) |
| 1050 compare = dart.as(core.Comparable.compare, dart.throw_("Unimplemented
type (dynamic, dynamic) → int")); |
| 948 Sort.sort(list, compare); | 1051 Sort.sort(list, compare); |
| 949 } | 1052 } |
| 950 static shuffleList(list, random) { | 1053 static shuffleList(list, random) { |
| 951 if (random === null) random = new math.Random(); | 1054 if (random === null) |
| 1055 random = new math.Random(); |
| 952 let length = list.length; | 1056 let length = list.length; |
| 953 while (length > 1) { | 1057 while (length > 1) { |
| 954 let pos = random.nextInt(length); | 1058 let pos = random.nextInt(length); |
| 955 length = 1; | 1059 length = 1; |
| 956 let tmp = list.get(length); | 1060 let tmp = list.get(length); |
| 957 list.set(length, list.get(pos)); | 1061 list.set(length, list.get(pos)); |
| 958 list.set(pos, tmp); | 1062 list.set(pos, tmp); |
| 959 } | 1063 } |
| 960 } | 1064 } |
| 961 static indexOfList(list, element, start) { | 1065 static indexOfList(list, element, start) { |
| 962 return Lists.indexOf(list, element, start, list.length); | 1066 return Lists.indexOf(list, element, start, list.length); |
| 963 } | 1067 } |
| 964 static lastIndexOfList(list, element, start) { | 1068 static lastIndexOfList(list, element, start) { |
| 965 if (start === null) start = list.length - 1; | 1069 if (start === null) |
| 1070 start = list.length - 1; |
| 966 return Lists.lastIndexOf(list, element, start); | 1071 return Lists.lastIndexOf(list, element, start); |
| 967 } | 1072 } |
| 968 static _rangeCheck(list, start, end) { | 1073 static _rangeCheck(list, start, end) { |
| 969 core.RangeError.checkValidRange(start, end, list.length); | 1074 core.RangeError.checkValidRange(start, end, list.length); |
| 970 } | 1075 } |
| 971 getRangeList(list, start, end) { | 1076 getRangeList(list, start, end) { |
| 972 _rangeCheck(list, start, end); | 1077 _rangeCheck(list, start, end); |
| 973 return new SubListIterable(list, start, end); | 1078 return new SubListIterable(list, start, end); |
| 974 } | 1079 } |
| 975 static setRangeList(list, start, end, from, skipCount) { | 1080 static setRangeList(list, start, end, from, skipCount) { |
| 976 _rangeCheck(list, start, end); | 1081 _rangeCheck(list, start, end); |
| 977 let length = end - start; | 1082 let length = end - start; |
| 978 if (length === 0) return; | 1083 if (length === 0) |
| 979 if (skipCount < 0) throw new core.ArgumentError(skipCount); | 1084 return; |
| 1085 if (skipCount < 0) |
| 1086 throw new core.ArgumentError(skipCount); |
| 980 let otherList = null; | 1087 let otherList = null; |
| 981 let otherStart = null; | 1088 let otherStart = null; |
| 982 if (dart.is(from, core.List)) { | 1089 if (dart.is(from, core.List)) { |
| 983 otherList = from; | 1090 otherList = from; |
| 984 otherStart = skipCount; | 1091 otherStart = skipCount; |
| 985 } else { | 1092 } else { |
| 986 otherList = from.skip(skipCount).toList({growable: false}); | 1093 otherList = from.skip(skipCount).toList({growable: false}); |
| 987 otherStart = 0; | 1094 otherStart = 0; |
| 988 } | 1095 } |
| 989 if (otherStart + length > otherList.length) { | 1096 if (otherStart + length > otherList.length) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 core.RangeError.checkValueInInterval(index, 0, list.length, "index"); | 1145 core.RangeError.checkValueInInterval(index, 0, list.length, "index"); |
| 1039 for (let element of iterable) { | 1146 for (let element of iterable) { |
| 1040 list.set(index++, element); | 1147 list.set(index++, element); |
| 1041 } | 1148 } |
| 1042 } | 1149 } |
| 1043 asMapList(l) { | 1150 asMapList(l) { |
| 1044 return new ListMapView(l); | 1151 return new ListMapView(l); |
| 1045 } | 1152 } |
| 1046 static setContainsAll(set, other) { | 1153 static setContainsAll(set, other) { |
| 1047 for (let element of other) { | 1154 for (let element of other) { |
| 1048 if (!dart.notNull(set.contains(element))) return false; | 1155 if (!dart.notNull(set.contains(element))) |
| 1156 return false; |
| 1049 } | 1157 } |
| 1050 return true; | 1158 return true; |
| 1051 } | 1159 } |
| 1052 static setIntersection(set, other, result) { | 1160 static setIntersection(set, other, result) { |
| 1053 let smaller = null; | 1161 let smaller = null; |
| 1054 let larger = null; | 1162 let larger = null; |
| 1055 if (set.length < other.length) { | 1163 if (set.length < other.length) { |
| 1056 smaller = set; | 1164 smaller = set; |
| 1057 larger = other; | 1165 larger = other; |
| 1058 } else { | 1166 } else { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1076 if (!dart.notNull(other.contains(element))) { | 1184 if (!dart.notNull(other.contains(element))) { |
| 1077 result.add(element); | 1185 result.add(element); |
| 1078 } | 1186 } |
| 1079 } | 1187 } |
| 1080 return result; | 1188 return result; |
| 1081 } | 1189 } |
| 1082 } | 1190 } |
| 1083 return IterableMixinWorkaround; | 1191 return IterableMixinWorkaround; |
| 1084 }); | 1192 }); |
| 1085 let IterableMixinWorkaround = IterableMixinWorkaround$(dynamic); | 1193 let IterableMixinWorkaround = IterableMixinWorkaround$(dynamic); |
| 1086 | |
| 1087 class IterableElementError extends dart.Object { | 1194 class IterableElementError extends dart.Object { |
| 1088 static noElement() { return new core.StateError("No element"); } | 1195 static noElement() { |
| 1089 static tooMany() { return new core.StateError("Too many elements"); } | 1196 return new core.StateError("No element"); |
| 1090 static tooFew() { return new core.StateError("Too few elements"); } | 1197 } |
| 1198 static tooMany() { |
| 1199 return new core.StateError("Too many elements"); |
| 1200 } |
| 1201 static tooFew() { |
| 1202 return new core.StateError("Too few elements"); |
| 1203 } |
| 1091 } | 1204 } |
| 1092 | |
| 1093 let FixedLengthListMixin$ = dart.generic(function(E) { | 1205 let FixedLengthListMixin$ = dart.generic(function(E) { |
| 1094 class FixedLengthListMixin extends dart.Object { | 1206 class FixedLengthListMixin extends dart.Object { |
| 1095 set length(newLength) { | 1207 set length(newLength) { |
| 1096 throw new core.UnsupportedError("Cannot change the length of a fixed-len
gth list"); | 1208 throw new core.UnsupportedError("Cannot change the length of a fixed-len
gth list"); |
| 1097 } | 1209 } |
| 1098 add(value) { | 1210 add(value) { |
| 1099 throw new core.UnsupportedError("Cannot add to a fixed-length list"); | 1211 throw new core.UnsupportedError("Cannot add to a fixed-length list"); |
| 1100 } | 1212 } |
| 1101 insert(index, value) { | 1213 insert(index, value) { |
| 1102 throw new core.UnsupportedError("Cannot add to a fixed-length list"); | 1214 throw new core.UnsupportedError("Cannot add to a fixed-length list"); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1128 removeRange(start, end) { | 1240 removeRange(start, end) { |
| 1129 throw new core.UnsupportedError("Cannot remove from a fixed-length list"
); | 1241 throw new core.UnsupportedError("Cannot remove from a fixed-length list"
); |
| 1130 } | 1242 } |
| 1131 replaceRange(start, end, iterable) { | 1243 replaceRange(start, end, iterable) { |
| 1132 throw new core.UnsupportedError("Cannot remove from a fixed-length list"
); | 1244 throw new core.UnsupportedError("Cannot remove from a fixed-length list"
); |
| 1133 } | 1245 } |
| 1134 } | 1246 } |
| 1135 return FixedLengthListMixin; | 1247 return FixedLengthListMixin; |
| 1136 }); | 1248 }); |
| 1137 let FixedLengthListMixin = FixedLengthListMixin$(dynamic); | 1249 let FixedLengthListMixin = FixedLengthListMixin$(dynamic); |
| 1138 | |
| 1139 let UnmodifiableListMixin$ = dart.generic(function(E) { | 1250 let UnmodifiableListMixin$ = dart.generic(function(E) { |
| 1140 class UnmodifiableListMixin extends dart.Object { | 1251 class UnmodifiableListMixin extends dart.Object { |
| 1141 set(index, value) { | 1252 set(index, value) { |
| 1142 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); | 1253 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); |
| 1143 } | 1254 } |
| 1144 set length(newLength) { | 1255 set length(newLength) { |
| 1145 throw new core.UnsupportedError("Cannot change the length of an unmodifi
able list"); | 1256 throw new core.UnsupportedError("Cannot change the length of an unmodifi
able list"); |
| 1146 } | 1257 } |
| 1147 setAll(at, iterable) { | 1258 setAll(at, iterable) { |
| 1148 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); | 1259 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1162 remove(element) { | 1273 remove(element) { |
| 1163 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1274 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1164 } | 1275 } |
| 1165 removeWhere(test) { | 1276 removeWhere(test) { |
| 1166 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1277 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1167 } | 1278 } |
| 1168 retainWhere(test) { | 1279 retainWhere(test) { |
| 1169 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1280 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1170 } | 1281 } |
| 1171 sort(compare) { | 1282 sort(compare) { |
| 1172 if (compare === undefined) compare = null; | 1283 if (compare === void 0) |
| 1284 compare = null; |
| 1173 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); | 1285 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); |
| 1174 } | 1286 } |
| 1175 shuffle(random) { | 1287 shuffle(random) { |
| 1176 if (random === undefined) random = null; | 1288 if (random === void 0) |
| 1289 random = null; |
| 1177 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); | 1290 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); |
| 1178 } | 1291 } |
| 1179 clear() { | 1292 clear() { |
| 1180 throw new core.UnsupportedError("Cannot clear an unmodifiable list"); | 1293 throw new core.UnsupportedError("Cannot clear an unmodifiable list"); |
| 1181 } | 1294 } |
| 1182 removeAt(index) { | 1295 removeAt(index) { |
| 1183 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1296 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1184 } | 1297 } |
| 1185 removeLast() { | 1298 removeLast() { |
| 1186 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1299 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1187 } | 1300 } |
| 1188 setRange(start, end, iterable, skipCount) { | 1301 setRange(start, end, iterable, skipCount) { |
| 1189 if (skipCount === undefined) skipCount = 0; | 1302 if (skipCount === void 0) |
| 1303 skipCount = 0; |
| 1190 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); | 1304 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); |
| 1191 } | 1305 } |
| 1192 removeRange(start, end) { | 1306 removeRange(start, end) { |
| 1193 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1307 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1194 } | 1308 } |
| 1195 replaceRange(start, end, iterable) { | 1309 replaceRange(start, end, iterable) { |
| 1196 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); | 1310 throw new core.UnsupportedError("Cannot remove from an unmodifiable list
"); |
| 1197 } | 1311 } |
| 1198 fillRange(start, end, fillValue) { | 1312 fillRange(start, end, fillValue) { |
| 1199 if (fillValue === undefined) fillValue = null; | 1313 if (fillValue === void 0) |
| 1314 fillValue = null; |
| 1200 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); | 1315 throw new core.UnsupportedError("Cannot modify an unmodifiable list"); |
| 1201 } | 1316 } |
| 1202 } | 1317 } |
| 1203 return UnmodifiableListMixin; | 1318 return UnmodifiableListMixin; |
| 1204 }); | 1319 }); |
| 1205 let UnmodifiableListMixin = UnmodifiableListMixin$(dynamic); | 1320 let UnmodifiableListMixin = UnmodifiableListMixin$(dynamic); |
| 1206 | |
| 1207 let FixedLengthListBase$ = dart.generic(function(E) { | 1321 let FixedLengthListBase$ = dart.generic(function(E) { |
| 1208 class FixedLengthListBase extends dart.mixin(FixedLengthListMixin$(E)) {} | 1322 class FixedLengthListBase extends dart.mixin(FixedLengthListMixin$(E)) { |
| 1209 | 1323 } |
| 1210 return FixedLengthListBase; | 1324 return FixedLengthListBase; |
| 1211 }); | 1325 }); |
| 1212 let FixedLengthListBase = FixedLengthListBase$(dynamic); | 1326 let FixedLengthListBase = FixedLengthListBase$(dynamic); |
| 1213 let UnmodifiableListBase$ = dart.generic(function(E) { | 1327 let UnmodifiableListBase$ = dart.generic(function(E) { |
| 1214 class UnmodifiableListBase extends dart.mixin(UnmodifiableListMixin$(E)) {} | 1328 class UnmodifiableListBase extends dart.mixin(UnmodifiableListMixin$(E)) { |
| 1215 | 1329 } |
| 1216 return UnmodifiableListBase; | 1330 return UnmodifiableListBase; |
| 1217 }); | 1331 }); |
| 1218 let UnmodifiableListBase = UnmodifiableListBase$(dynamic); | 1332 let UnmodifiableListBase = UnmodifiableListBase$(dynamic); |
| 1219 class _ListIndicesIterable extends ListIterable$(core.int) { | 1333 class _ListIndicesIterable extends ListIterable$(core.int) { |
| 1220 _ListIndicesIterable(_backedList) { | 1334 _ListIndicesIterable(_backedList) { |
| 1221 this._backedList = _backedList; | 1335 this._backedList = _backedList; |
| 1222 super.ListIterable(); | 1336 super.ListIterable(); |
| 1223 } | 1337 } |
| 1224 get length() { return this._backedList.length; } | 1338 get length() { |
| 1339 return this._backedList.length; |
| 1340 } |
| 1225 elementAt(index) { | 1341 elementAt(index) { |
| 1226 core.RangeError.checkValidIndex(index, this); | 1342 core.RangeError.checkValidIndex(index, this); |
| 1227 return index; | 1343 return index; |
| 1228 } | 1344 } |
| 1229 } | 1345 } |
| 1230 | |
| 1231 let ListMapView$ = dart.generic(function(E) { | 1346 let ListMapView$ = dart.generic(function(E) { |
| 1232 class ListMapView extends dart.Object { | 1347 class ListMapView extends dart.Object { |
| 1233 ListMapView(_values) { | 1348 ListMapView(_values) { |
| 1234 this._values = _values; | 1349 this._values = _values; |
| 1235 } | 1350 } |
| 1236 get(key) { return dart.as(this.containsKey(key) ? this._values.get(key) :
null, E); } | 1351 get(key) { |
| 1237 get length() { return this._values.length; } | 1352 return dart.as(this.containsKey(key) ? this._values.get(key) : null, E); |
| 1238 get values() { return new SubListIterable(this._values, 0, null); } | 1353 } |
| 1239 get keys() { return new _ListIndicesIterable(this._values); } | 1354 get length() { |
| 1240 get isEmpty() { return this._values.isEmpty; } | 1355 return this._values.length; |
| 1241 get isNotEmpty() { return this._values.isNotEmpty; } | 1356 } |
| 1242 containsValue(value) { return this._values.contains(value); } | 1357 get values() { |
| 1243 containsKey(key) { return dart.notNull(dart.notNull(typeof key == "number"
) && dart.notNull(key >= 0)) && dart.notNull(key < this.length); } | 1358 return new SubListIterable(this._values, 0, null); |
| 1359 } |
| 1360 get keys() { |
| 1361 return new _ListIndicesIterable(this._values); |
| 1362 } |
| 1363 get isEmpty() { |
| 1364 return this._values.isEmpty; |
| 1365 } |
| 1366 get isNotEmpty() { |
| 1367 return this._values.isNotEmpty; |
| 1368 } |
| 1369 containsValue(value) { |
| 1370 return this._values.contains(value); |
| 1371 } |
| 1372 containsKey(key) { |
| 1373 return dart.notNull(dart.notNull(typeof key == number) && dart.notNull(k
ey >= 0)) && dart.notNull(key < this.length); |
| 1374 } |
| 1244 forEach(f) { | 1375 forEach(f) { |
| 1245 let length = this._values.length; | 1376 let length = this._values.length; |
| 1246 for (let i = 0; i < length; i++) { | 1377 for (let i = 0; i < length; i++) { |
| 1247 f(i, this._values.get(i)); | 1378 f(i, this._values.get(i)); |
| 1248 if (length !== this._values.length) { | 1379 if (length !== this._values.length) { |
| 1249 throw new core.ConcurrentModificationError(this._values); | 1380 throw new core.ConcurrentModificationError(this._values); |
| 1250 } | 1381 } |
| 1251 } | 1382 } |
| 1252 } | 1383 } |
| 1253 set(key, value) { | 1384 set(key, value) { |
| 1254 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); | 1385 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); |
| 1255 } | 1386 } |
| 1256 putIfAbsent(key, ifAbsent) { | 1387 putIfAbsent(key, ifAbsent) { |
| 1257 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); | 1388 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); |
| 1258 } | 1389 } |
| 1259 remove(key) { | 1390 remove(key) { |
| 1260 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); | 1391 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); |
| 1261 } | 1392 } |
| 1262 clear() { | 1393 clear() { |
| 1263 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); | 1394 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); |
| 1264 } | 1395 } |
| 1265 addAll(other) { | 1396 addAll(other) { |
| 1266 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); | 1397 throw new core.UnsupportedError("Cannot modify an unmodifiable map"); |
| 1267 } | 1398 } |
| 1268 toString() { return collection.Maps.mapToString(this); } | 1399 toString() { |
| 1400 return collection.Maps.mapToString(this); |
| 1401 } |
| 1269 } | 1402 } |
| 1270 return ListMapView; | 1403 return ListMapView; |
| 1271 }); | 1404 }); |
| 1272 let ListMapView = ListMapView$(dynamic); | 1405 let ListMapView = ListMapView$(dynamic); |
| 1273 | |
| 1274 let ReversedListIterable$ = dart.generic(function(E) { | 1406 let ReversedListIterable$ = dart.generic(function(E) { |
| 1275 class ReversedListIterable extends ListIterable$(E) { | 1407 class ReversedListIterable extends ListIterable$(E) { |
| 1276 ReversedListIterable(_source) { | 1408 ReversedListIterable(_source) { |
| 1277 this._source = _source; | 1409 this._source = _source; |
| 1278 super.ListIterable(); | 1410 super.ListIterable(); |
| 1279 } | 1411 } |
| 1280 get length() { return this._source.length; } | 1412 get length() { |
| 1281 elementAt(index) { return this._source.elementAt(this._source.length - 1 -
index); } | 1413 return this._source.length; |
| 1414 } |
| 1415 elementAt(index) { |
| 1416 return this._source.elementAt(this._source.length - 1 - index); |
| 1417 } |
| 1282 } | 1418 } |
| 1283 return ReversedListIterable; | 1419 return ReversedListIterable; |
| 1284 }); | 1420 }); |
| 1285 let ReversedListIterable = ReversedListIterable$(dynamic); | 1421 let ReversedListIterable = ReversedListIterable$(dynamic); |
| 1286 | |
| 1287 class UnmodifiableListError extends dart.Object { | 1422 class UnmodifiableListError extends dart.Object { |
| 1288 static add() { return new core.UnsupportedError("Cannot add to unmodifiable
List"); } | 1423 static add() { |
| 1289 static change() { return new core.UnsupportedError("Cannot change the conten
t of an unmodifiable List"); } | 1424 return new core.UnsupportedError("Cannot add to unmodifiable List"); |
| 1290 static length() { return new core.UnsupportedError("Cannot change length of
unmodifiable List"); } | 1425 } |
| 1291 static remove() { return new core.UnsupportedError("Cannot remove from unmod
ifiable List"); } | 1426 static change() { |
| 1427 return new core.UnsupportedError("Cannot change the content of an unmodifi
able List"); |
| 1428 } |
| 1429 static length() { |
| 1430 return new core.UnsupportedError("Cannot change length of unmodifiable Lis
t"); |
| 1431 } |
| 1432 static remove() { |
| 1433 return new core.UnsupportedError("Cannot remove from unmodifiable List"); |
| 1434 } |
| 1292 } | 1435 } |
| 1293 | |
| 1294 class NonGrowableListError extends dart.Object { | 1436 class NonGrowableListError extends dart.Object { |
| 1295 static add() { return new core.UnsupportedError("Cannot add to non-growable
List"); } | 1437 static add() { |
| 1296 static length() { return new core.UnsupportedError("Cannot change length of
non-growable List"); } | 1438 return new core.UnsupportedError("Cannot add to non-growable List"); |
| 1297 static remove() { return new core.UnsupportedError("Cannot remove from non-g
rowable List"); } | 1439 } |
| 1440 static length() { |
| 1441 return new core.UnsupportedError("Cannot change length of non-growable Lis
t"); |
| 1442 } |
| 1443 static remove() { |
| 1444 return new core.UnsupportedError("Cannot remove from non-growable List"); |
| 1445 } |
| 1298 } | 1446 } |
| 1299 | |
| 1300 // Function makeListFixedLength: (List<dynamic>) → List | 1447 // Function makeListFixedLength: (List<dynamic>) → List |
| 1301 function makeListFixedLength(growableList) { | 1448 function makeListFixedLength(growableList) { |
| 1302 dart.dinvoke(/* Unimplemented unknown name */JSArray, "markFixedList", growa
bleList); | 1449 dart.dinvoke(/* Unimplemented unknown name */JSArray, 'markFixedList', growa
bleList); |
| 1303 return growableList; | 1450 return growableList; |
| 1304 } | 1451 } |
| 1305 | |
| 1306 class Lists extends dart.Object { | 1452 class Lists extends dart.Object { |
| 1307 static copy(src, srcStart, dst, dstStart, count) { | 1453 static copy(src, srcStart, dst, dstStart, count) { |
| 1308 if (srcStart < dstStart) { | 1454 if (srcStart < dstStart) { |
| 1309 for (let i = srcStart + count - 1, j = dstStart + count - 1; i >= srcSta
rt; i--, j--) { | 1455 for (let i = srcStart + count - 1, j = dstStart + count - 1; i >= srcSta
rt; i--, j--) { |
| 1310 dst.set(j, src.get(i)); | 1456 dst.set(j, src.get(i)); |
| 1311 } | 1457 } |
| 1312 } else { | 1458 } else { |
| 1313 for (let i = srcStart, j = dstStart; i < srcStart + count; i++, j++) { | 1459 for (let i = srcStart, j = dstStart; i < srcStart + count; i++, j++) { |
| 1314 dst.set(j, src.get(i)); | 1460 dst.set(j, src.get(i)); |
| 1315 } | 1461 } |
| 1316 } | 1462 } |
| 1317 } | 1463 } |
| 1318 static areEqual(a, b) { | 1464 static areEqual(a, b) { |
| 1319 if (core.identical(a, b)) return true; | 1465 if (core.identical(a, b)) |
| 1320 if (!dart.notNull((dart.is(b, core.List)))) return false; | 1466 return true; |
| 1467 if (!dart.notNull(dart.is(b, core.List))) |
| 1468 return false; |
| 1321 let length = a.length; | 1469 let length = a.length; |
| 1322 if (length !== dart.dload(b, "length")) return false; | 1470 if (length !== dart.dload(b, 'length')) |
| 1471 return false; |
| 1323 for (let i = 0; i < length; i++) { | 1472 for (let i = 0; i < length; i++) { |
| 1324 if (!dart.notNull(core.identical(a.get(i), dart.dindex(b, i)))) return f
alse; | 1473 if (!dart.notNull(core.identical(a.get(i), dart.dindex(b, i)))) |
| 1474 return false; |
| 1325 } | 1475 } |
| 1326 return true; | 1476 return true; |
| 1327 } | 1477 } |
| 1328 static indexOf(a, element, startIndex, endIndex) { | 1478 static indexOf(a, element, startIndex, endIndex) { |
| 1329 if (startIndex >= a.length) { | 1479 if (startIndex >= a.length) { |
| 1330 return -1; | 1480 return -1; |
| 1331 } | 1481 } |
| 1332 if (startIndex < 0) { | 1482 if (startIndex < 0) { |
| 1333 startIndex = 0; | 1483 startIndex = 0; |
| 1334 } | 1484 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1358 } | 1508 } |
| 1359 static rangeCheck(a, start, length) { | 1509 static rangeCheck(a, start, length) { |
| 1360 core.RangeError.checkNotNegative(length); | 1510 core.RangeError.checkNotNegative(length); |
| 1361 core.RangeError.checkNotNegative(start); | 1511 core.RangeError.checkNotNegative(start); |
| 1362 if (start + length > a.length) { | 1512 if (start + length > a.length) { |
| 1363 let message = `${start} + ${length} must be in the range [0..${a.length}
]`; | 1513 let message = `${start} + ${length} must be in the range [0..${a.length}
]`; |
| 1364 throw new core.RangeError.range(length, 0, a.length - start, "length", m
essage); | 1514 throw new core.RangeError.range(length, 0, a.length - start, "length", m
essage); |
| 1365 } | 1515 } |
| 1366 } | 1516 } |
| 1367 } | 1517 } |
| 1368 | |
| 1369 _internal.printToZone = null; | 1518 _internal.printToZone = null; |
| 1370 // Function printToConsole: (String) → void | 1519 // Function printToConsole: (String) → void |
| 1371 function printToConsole(line) { | 1520 function printToConsole(line) { |
| 1372 dart.dinvokef(/* Unimplemented unknown name */printString, `${line}`); | 1521 dart.dinvokef(/* Unimplemented unknown name */printString, `${line}`); |
| 1373 } | 1522 } |
| 1374 | |
| 1375 class Sort extends dart.Object { | 1523 class Sort extends dart.Object { |
| 1376 static sort(a, compare) { | 1524 static sort(a, compare) { |
| 1377 _doSort(a, 0, a.length - 1, compare); | 1525 _doSort(a, 0, a.length - 1, compare); |
| 1378 } | 1526 } |
| 1379 static sortRange(a, from, to, compare) { | 1527 static sortRange(a, from, to, compare) { |
| 1380 if (dart.notNull(dart.notNull((from < 0)) || dart.notNull((to > a.length))
) || dart.notNull((to < from))) { | 1528 if (dart.notNull(dart.notNull(from < 0) || dart.notNull(to > a.length)) ||
dart.notNull(to < from)) { |
| 1381 throw "OutOfRange"; | 1529 throw "OutOfRange"; |
| 1382 } | 1530 } |
| 1383 _doSort(a, from, to - 1, compare); | 1531 _doSort(a, from, to - 1, compare); |
| 1384 } | 1532 } |
| 1385 static _doSort(a, left, right, compare) { | 1533 static _doSort(a, left, right, compare) { |
| 1386 if ((right - left) <= _INSERTION_SORT_THRESHOLD) { | 1534 if (right - left <= _INSERTION_SORT_THRESHOLD) { |
| 1387 _insertionSort(a, left, right, compare); | 1535 _insertionSort(a, left, right, compare); |
| 1388 } else { | 1536 } else { |
| 1389 _dualPivotQuicksort(a, left, right, compare); | 1537 _dualPivotQuicksort(a, left, right, compare); |
| 1390 } | 1538 } |
| 1391 } | 1539 } |
| 1392 static _insertionSort(a, left, right, compare) { | 1540 static _insertionSort(a, left, right, compare) { |
| 1393 for (let i = left + 1; i <= right; i++) { | 1541 for (let i = left + 1; i <= right; i++) { |
| 1394 let el = a.get(i); | 1542 let el = a.get(i); |
| 1395 let j = i; | 1543 let j = i; |
| 1396 while (dart.notNull((j > left)) && dart.notNull((compare(a.get(j - 1), e
l) > 0))) { | 1544 while (dart.notNull(j > left) && dart.notNull(compare(a.get(j - 1), el)
> 0)) { |
| 1397 a.set(j, a.get(j - 1)); | 1545 a.set(j, a.get(j - 1)); |
| 1398 j--; | 1546 j--; |
| 1399 } | 1547 } |
| 1400 a.set(j, el); | 1548 a.set(j, el); |
| 1401 } | 1549 } |
| 1402 } | 1550 } |
| 1403 static _dualPivotQuicksort(a, left, right, compare) { | 1551 static _dualPivotQuicksort(a, left, right, compare) { |
| 1404 dart.assert(right - left > _INSERTION_SORT_THRESHOLD); | 1552 dart.assert(right - left > _INSERTION_SORT_THRESHOLD); |
| 1405 let sixth = ((right - left + 1) / 6).truncate(); | 1553 let sixth = ((right - left + 1) / 6).truncate(); |
| 1406 let index1 = left + sixth; | 1554 let index1 = left + sixth; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 } | 1608 } |
| 1461 let pivot1 = el2; | 1609 let pivot1 = el2; |
| 1462 let pivot2 = el4; | 1610 let pivot2 = el4; |
| 1463 a.set(index1, el1); | 1611 a.set(index1, el1); |
| 1464 a.set(index3, el3); | 1612 a.set(index3, el3); |
| 1465 a.set(index5, el5); | 1613 a.set(index5, el5); |
| 1466 a.set(index2, a.get(left)); | 1614 a.set(index2, a.get(left)); |
| 1467 a.set(index4, a.get(right)); | 1615 a.set(index4, a.get(right)); |
| 1468 let less = left + 1; | 1616 let less = left + 1; |
| 1469 let great = right - 1; | 1617 let great = right - 1; |
| 1470 let pivots_are_equal = (compare(pivot1, pivot2) === 0); | 1618 let pivots_are_equal = compare(pivot1, pivot2) === 0; |
| 1471 if (pivots_are_equal) { | 1619 if (pivots_are_equal) { |
| 1472 let pivot = pivot1; | 1620 let pivot = pivot1; |
| 1473 for (let k = less; k <= great; k++) { | 1621 for (let k = less; k <= great; k++) { |
| 1474 let ak = a.get(k); | 1622 let ak = a.get(k); |
| 1475 let comp = compare(ak, pivot); | 1623 let comp = compare(ak, pivot); |
| 1476 if (comp === 0) continue; | 1624 if (comp === 0) |
| 1625 continue; |
| 1477 if (comp < 0) { | 1626 if (comp < 0) { |
| 1478 if (k !== less) { | 1627 if (k !== less) { |
| 1479 a.set(k, a.get(less)); | 1628 a.set(k, a.get(less)); |
| 1480 a.set(less, ak); | 1629 a.set(less, ak); |
| 1481 } | 1630 } |
| 1482 less++; | 1631 less++; |
| 1483 } else { | 1632 } else { |
| 1484 while (true) { | 1633 while (true) { |
| 1485 comp = compare(a.get(great), pivot); | 1634 comp = compare(a.get(great), pivot); |
| 1486 if (comp > 0) { | 1635 if (comp > 0) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1509 a.set(less, ak); | 1658 a.set(less, ak); |
| 1510 } | 1659 } |
| 1511 less++; | 1660 less++; |
| 1512 } else { | 1661 } else { |
| 1513 let comp_pivot2 = compare(ak, pivot2); | 1662 let comp_pivot2 = compare(ak, pivot2); |
| 1514 if (comp_pivot2 > 0) { | 1663 if (comp_pivot2 > 0) { |
| 1515 while (true) { | 1664 while (true) { |
| 1516 let comp = compare(a.get(great), pivot2); | 1665 let comp = compare(a.get(great), pivot2); |
| 1517 if (comp > 0) { | 1666 if (comp > 0) { |
| 1518 great--; | 1667 great--; |
| 1519 if (great < k) break; | 1668 if (great < k) |
| 1669 break; |
| 1520 continue; | 1670 continue; |
| 1521 } else { | 1671 } else { |
| 1522 comp = compare(a.get(great), pivot1); | 1672 comp = compare(a.get(great), pivot1); |
| 1523 if (comp < 0) { | 1673 if (comp < 0) { |
| 1524 a.set(k, a.get(less)); | 1674 a.set(k, a.get(less)); |
| 1525 a.set(less++, a.get(great)); | 1675 a.set(less++, a.get(great)); |
| 1526 a.set(great--, ak); | 1676 a.set(great--, ak); |
| 1527 } else { | 1677 } else { |
| 1528 a.set(k, a.get(great)); | 1678 a.set(k, a.get(great)); |
| 1529 a.set(great--, ak); | 1679 a.set(great--, ak); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1560 a.set(less, ak); | 1710 a.set(less, ak); |
| 1561 } | 1711 } |
| 1562 less++; | 1712 less++; |
| 1563 } else { | 1713 } else { |
| 1564 let comp_pivot2 = compare(ak, pivot2); | 1714 let comp_pivot2 = compare(ak, pivot2); |
| 1565 if (comp_pivot2 === 0) { | 1715 if (comp_pivot2 === 0) { |
| 1566 while (true) { | 1716 while (true) { |
| 1567 let comp = compare(a.get(great), pivot2); | 1717 let comp = compare(a.get(great), pivot2); |
| 1568 if (comp === 0) { | 1718 if (comp === 0) { |
| 1569 great--; | 1719 great--; |
| 1570 if (great < k) break; | 1720 if (great < k) |
| 1721 break; |
| 1571 continue; | 1722 continue; |
| 1572 } else { | 1723 } else { |
| 1573 comp = compare(a.get(great), pivot1); | 1724 comp = compare(a.get(great), pivot1); |
| 1574 if (comp < 0) { | 1725 if (comp < 0) { |
| 1575 a.set(k, a.get(less)); | 1726 a.set(k, a.get(less)); |
| 1576 a.set(less++, a.get(great)); | 1727 a.set(less++, a.get(great)); |
| 1577 a.set(great--, ak); | 1728 a.set(great--, ak); |
| 1578 } else { | 1729 } else { |
| 1579 a.set(k, a.get(great)); | 1730 a.set(k, a.get(great)); |
| 1580 a.set(great--, ak); | 1731 a.set(great--, ak); |
| 1581 } | 1732 } |
| 1582 break; | 1733 break; |
| 1583 } | 1734 } |
| 1584 } | 1735 } |
| 1585 } | 1736 } |
| 1586 } | 1737 } |
| 1587 } | 1738 } |
| 1588 _doSort(a, less, great, compare); | 1739 _doSort(a, less, great, compare); |
| 1589 } else { | 1740 } else { |
| 1590 _doSort(a, less, great, compare); | 1741 _doSort(a, less, great, compare); |
| 1591 } | 1742 } |
| 1592 } | 1743 } |
| 1593 } | 1744 } |
| 1594 Sort._INSERTION_SORT_THRESHOLD = 32; | 1745 Sort._INSERTION_SORT_THRESHOLD = 32; |
| 1595 | |
| 1596 class Symbol extends dart.Object { | 1746 class Symbol extends dart.Object { |
| 1597 Symbol(name) { | 1747 Symbol(name) { |
| 1598 this._name = name; | 1748 this._name = name; |
| 1599 } | 1749 } |
| 1600 Symbol$unvalidated(_name) { | 1750 Symbol$unvalidated(_name) { |
| 1601 this._name = _name; | 1751 this._name = _name; |
| 1602 } | 1752 } |
| 1603 Symbol$validated(name) { | 1753 Symbol$validated(name) { |
| 1604 this._name = validatePublicSymbol(name); | 1754 this._name = validatePublicSymbol(name); |
| 1605 } | 1755 } |
| 1606 ['=='](other) { return dart.notNull(dart.is(other, Symbol)) && dart.notNull(
dart.equals(this._name, dart.dload(other, "_name"))); } | 1756 ['=='](other) { |
| 1757 return dart.notNull(dart.is(other, Symbol)) && dart.notNull(dart.equals(th
is._name, dart.dload(other, '_name'))); |
| 1758 } |
| 1607 get hashCode() { | 1759 get hashCode() { |
| 1608 let arbitraryPrime = 664597; | 1760 let arbitraryPrime = 664597; |
| 1609 return 536870911 & (arbitraryPrime * this._name.hashCode); | 1761 return 536870911 & arbitraryPrime * this._name.hashCode; |
| 1610 } | 1762 } |
| 1611 toString() { return `Symbol("${this._name}")`; } | 1763 toString() { |
| 1612 static getName(symbol) { return symbol._name; } | 1764 return `Symbol("${this._name}")`; |
| 1765 } |
| 1766 static getName(symbol) { |
| 1767 return symbol._name; |
| 1768 } |
| 1613 static validatePublicSymbol(name) { | 1769 static validatePublicSymbol(name) { |
| 1614 if (dart.notNull(name.isEmpty) || dart.notNull(publicSymbolPattern.hasMatc
h(name))) return name; | 1770 if (dart.notNull(name.isEmpty) || dart.notNull(publicSymbolPattern.hasMatc
h(name))) |
| 1771 return name; |
| 1615 if (name.startsWith('_')) { | 1772 if (name.startsWith('_')) { |
| 1616 throw new core.ArgumentError(`"${name}" is a private identifier`); | 1773 throw new core.ArgumentError(`"${name}" is a private identifier`); |
| 1617 } | 1774 } |
| 1618 throw new core.ArgumentError(`"${name}" is not a valid (qualified) symbol
name`); | 1775 throw new core.ArgumentError(`"${name}" is not a valid (qualified) symbol
name`); |
| 1619 } | 1776 } |
| 1620 static isValidSymbol(name) { | 1777 static isValidSymbol(name) { |
| 1621 return (dart.notNull(name.isEmpty) || dart.notNull(symbolPattern.hasMatch(
name))); | 1778 return dart.notNull(name.isEmpty) || dart.notNull(symbolPattern.hasMatch(n
ame)); |
| 1622 } | 1779 } |
| 1623 } | 1780 } |
| 1624 dart.defineNamedConstructor(Symbol, "unvalidated"); | 1781 dart.defineNamedConstructor(Symbol, 'unvalidated'); |
| 1625 dart.defineNamedConstructor(Symbol, "validated"); | 1782 dart.defineNamedConstructor(Symbol, 'validated'); |
| 1626 Symbol.reservedWordRE = '(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|
d(?:efault|o)|' + | 1783 Symbol.reservedWordRE = '(?:assert|break|c(?:a(?:se|tch)|lass|on(?:st|tinue))|
d(?:efault|o)|' + 'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ul
l)|' + 'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|' + 'v(?:ar|o
id)|w(?:hile|ith))'; |
| 1627 'e(?:lse|num|xtends)|f(?:alse|inal(?:ly)?|or)|i[fns]|n(?:ew|ull)|' + | 1784 Symbol.publicIdentifierRE = '(?!' + `${reservedWordRE}` + '\\b(?!\\$))[a-zA-Z$
][\\w$]*'; |
| 1628 'ret(?:hrow|urn)|s(?:uper|witch)|t(?:h(?:is|row)|r(?:ue|y))|' + | 1785 Symbol.identifierRE = '(?!' + `${reservedWordRE}` + '\\b(?!\\$))[a-zA-Z$_][\\w
$]*'; |
| 1629 'v(?:ar|oid)|w(?:hile|ith))'; | |
| 1630 Symbol.publicIdentifierRE = '(?!' + | |
| 1631 `${reservedWordRE}` + | |
| 1632 '\\b(?!\\$))[a-zA-Z$][\\w$]*'; | |
| 1633 Symbol.identifierRE = '(?!' + | |
| 1634 `${reservedWordRE}` + | |
| 1635 '\\b(?!\\$))[a-zA-Z$_][\\w$]*'; | |
| 1636 Symbol.operatorRE = '(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)'; | 1786 Symbol.operatorRE = '(?:[\\-+*/%&|^]|\\[\\]=?|==|~/?|<[<=]?|>[>=]?|unary-)'; |
| 1637 dart.defineLazyProperties(Symbol, { | 1787 dart.defineLazyProperties(Symbol, { |
| 1638 get publicSymbolPattern() { return new core.RegExp(`^(?:${operatorRE}$|${pub
licIdentifierRE}(?:=?$|[.](?!$)))+?$`) }, | 1788 get publicSymbolPattern() { |
| 1639 get symbolPattern() { return new core.RegExp(`^(?:${operatorRE}$|${identifie
rRE}(?:=?$|[.](?!$)))+?$`) }, | 1789 return new core.RegExp(`^(?:${operatorRE}$|${publicIdentifierRE}(?:=?$|[.]
(?!$)))+?$`); |
| 1790 }, |
| 1791 get symbolPattern() { |
| 1792 return new core.RegExp(`^(?:${operatorRE}$|${identifierRE}(?:=?$|[.](?!$))
)+?$`); |
| 1793 } |
| 1640 }); | 1794 }); |
| 1641 | |
| 1642 // Exports: | 1795 // Exports: |
| 1643 _internal.POWERS_OF_TEN = POWERS_OF_TEN; | 1796 _internal.POWERS_OF_TEN = POWERS_OF_TEN; |
| 1644 _internal.EfficientLength = EfficientLength; | 1797 _internal.EfficientLength = EfficientLength; |
| 1645 _internal.ListIterable = ListIterable; | 1798 _internal.ListIterable = ListIterable; |
| 1646 _internal.ListIterable$ = ListIterable$; | 1799 _internal.ListIterable$ = ListIterable$; |
| 1647 _internal.SubListIterable = SubListIterable; | 1800 _internal.SubListIterable = SubListIterable; |
| 1648 _internal.SubListIterable$ = SubListIterable$; | 1801 _internal.SubListIterable$ = SubListIterable$; |
| 1649 _internal.ListIterator = ListIterator; | 1802 _internal.ListIterator = ListIterator; |
| 1650 _internal.ListIterator$ = ListIterator$; | 1803 _internal.ListIterator$ = ListIterator$; |
| 1651 _internal.MappedIterable = MappedIterable; | 1804 _internal.MappedIterable = MappedIterable; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 _internal.EmptyIterator$ = EmptyIterator$; | 1843 _internal.EmptyIterator$ = EmptyIterator$; |
| 1691 _internal.BidirectionalIterator = BidirectionalIterator; | 1844 _internal.BidirectionalIterator = BidirectionalIterator; |
| 1692 _internal.BidirectionalIterator$ = BidirectionalIterator$; | 1845 _internal.BidirectionalIterator$ = BidirectionalIterator$; |
| 1693 _internal.IterableMixinWorkaround = IterableMixinWorkaround; | 1846 _internal.IterableMixinWorkaround = IterableMixinWorkaround; |
| 1694 _internal.IterableMixinWorkaround$ = IterableMixinWorkaround$; | 1847 _internal.IterableMixinWorkaround$ = IterableMixinWorkaround$; |
| 1695 _internal.IterableElementError = IterableElementError; | 1848 _internal.IterableElementError = IterableElementError; |
| 1696 _internal.FixedLengthListMixin = FixedLengthListMixin; | 1849 _internal.FixedLengthListMixin = FixedLengthListMixin; |
| 1697 _internal.FixedLengthListMixin$ = FixedLengthListMixin$; | 1850 _internal.FixedLengthListMixin$ = FixedLengthListMixin$; |
| 1698 _internal.UnmodifiableListMixin = UnmodifiableListMixin; | 1851 _internal.UnmodifiableListMixin = UnmodifiableListMixin; |
| 1699 _internal.UnmodifiableListMixin$ = UnmodifiableListMixin$; | 1852 _internal.UnmodifiableListMixin$ = UnmodifiableListMixin$; |
| 1853 _internal.FixedLengthListBase = FixedLengthListBase; |
| 1700 _internal.FixedLengthListBase$ = FixedLengthListBase$; | 1854 _internal.FixedLengthListBase$ = FixedLengthListBase$; |
| 1701 _internal.FixedLengthListBase = FixedLengthListBase; | 1855 _internal.UnmodifiableListBase = UnmodifiableListBase; |
| 1702 _internal.UnmodifiableListBase$ = UnmodifiableListBase$; | 1856 _internal.UnmodifiableListBase$ = UnmodifiableListBase$; |
| 1703 _internal.UnmodifiableListBase = UnmodifiableListBase; | |
| 1704 _internal.ListMapView = ListMapView; | 1857 _internal.ListMapView = ListMapView; |
| 1705 _internal.ListMapView$ = ListMapView$; | 1858 _internal.ListMapView$ = ListMapView$; |
| 1706 _internal.ReversedListIterable = ReversedListIterable; | 1859 _internal.ReversedListIterable = ReversedListIterable; |
| 1707 _internal.ReversedListIterable$ = ReversedListIterable$; | 1860 _internal.ReversedListIterable$ = ReversedListIterable$; |
| 1708 _internal.UnmodifiableListError = UnmodifiableListError; | 1861 _internal.UnmodifiableListError = UnmodifiableListError; |
| 1709 _internal.NonGrowableListError = NonGrowableListError; | 1862 _internal.NonGrowableListError = NonGrowableListError; |
| 1710 _internal.makeListFixedLength = makeListFixedLength; | 1863 _internal.makeListFixedLength = makeListFixedLength; |
| 1711 _internal.Lists = Lists; | 1864 _internal.Lists = Lists; |
| 1712 _internal.printToConsole = printToConsole; | 1865 _internal.printToConsole = printToConsole; |
| 1713 _internal.Sort = Sort; | 1866 _internal.Sort = Sort; |
| 1714 _internal.Symbol = Symbol; | 1867 _internal.Symbol = Symbol; |
| 1715 })(_internal || (_internal = {})); | 1868 })(_internal || (_internal = {})); |
| OLD | NEW |