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

Side by Side Diff: lib/dom/frog/dom_frog.dart

Issue 10332038: FileList is a sequence - make it have indexer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/dom/idl/dart/dart.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('dom'); 1 #library('dom');
2 2
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 // DO NOT EDIT 7 // DO NOT EDIT
8 // Auto-generated Dart DOM library. 8 // Auto-generated Dart DOM library.
9 9
10 10
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 2263
2264 final String name; 2264 final String name;
2265 2265
2266 String toString() native; 2266 String toString() native;
2267 } 2267 }
2268 2268
2269 class _FileListJs extends _DOMTypeJs implements FileList native "*FileList" { 2269 class _FileListJs extends _DOMTypeJs implements FileList native "*FileList" {
2270 2270
2271 final int length; 2271 final int length;
2272 2272
2273 _FileJs operator[](int index) native "return this[index];";
2274
2275 void operator[]=(int index, _FileJs value) {
2276 throw new UnsupportedOperationException("Cannot assign element of immutable List.");
2277 }
2278 // -- start List<File> mixins.
2279 // File is the element type.
2280
2281 // From Iterable<File>:
2282
2283 Iterator<File> iterator() {
2284 // Note: NodeLists are not fixed size. And most probably length shouldn't
2285 // be cached in both iterator _and_ forEach method. For now caching it
2286 // for consistency.
2287 return new _FixedSizeListIterator<File>(this);
2288 }
2289
2290 // From Collection<File>:
2291
2292 void add(File value) {
2293 throw new UnsupportedOperationException("Cannot add to immutable List.");
2294 }
2295
2296 void addLast(File value) {
2297 throw new UnsupportedOperationException("Cannot add to immutable List.");
2298 }
2299
2300 void addAll(Collection<File> collection) {
2301 throw new UnsupportedOperationException("Cannot add to immutable List.");
2302 }
2303
2304 void forEach(void f(File element)) => _Collections.forEach(this, f);
2305
2306 Collection map(f(File element)) => _Collections.map(this, [], f);
2307
2308 Collection<File> filter(bool f(File element)) =>
2309 _Collections.filter(this, <File>[], f);
2310
2311 bool every(bool f(File element)) => _Collections.every(this, f);
2312
2313 bool some(bool f(File element)) => _Collections.some(this, f);
2314
2315 bool isEmpty() => this.length == 0;
2316
2317 // From List<File>:
2318
2319 void sort(int compare(File a, File b)) {
2320 throw new UnsupportedOperationException("Cannot sort immutable List.");
2321 }
2322
2323 int indexOf(File element, [int start = 0]) =>
2324 _Lists.indexOf(this, element, start, this.length);
2325
2326 int lastIndexOf(File element, [int start]) {
2327 if (start === null) start = length - 1;
2328 return _Lists.lastIndexOf(this, element, start);
2329 }
2330
2331 File last() => this[length - 1];
2332
2333 File removeLast() {
2334 throw new UnsupportedOperationException("Cannot removeLast on immutable List .");
2335 }
2336
2337 // FIXME: implement these.
2338 void setRange(int start, int rangeLength, List<File> from, [int startFrom]) {
2339 throw new UnsupportedOperationException("Cannot setRange on immutable List." );
2340 }
2341
2342 void removeRange(int start, int rangeLength) {
2343 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis t.");
2344 }
2345
2346 void insertRange(int start, int rangeLength, [File initialValue]) {
2347 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis t.");
2348 }
2349
2350 List<File> getRange(int start, int rangeLength) =>
2351 _Lists.getRange(this, start, rangeLength, <File>[]);
2352
2353 // -- end List<File> mixins.
2354
2273 _FileJs item(int index) native; 2355 _FileJs item(int index) native;
2274 } 2356 }
2275 2357
2276 class _FileReaderJs extends _EventTargetJs implements FileReader native "*FileRe ader" { 2358 class _FileReaderJs extends _EventTargetJs implements FileReader native "*FileRe ader" {
2277 2359
2278 static final int DONE = 2; 2360 static final int DONE = 2;
2279 2361
2280 static final int EMPTY = 0; 2362 static final int EMPTY = 0;
2281 2363
2282 static final int LOADING = 1; 2364 static final int LOADING = 1;
(...skipping 12726 matching lines...) Expand 10 before | Expand all | Expand 10 after
15009 final String name; 15091 final String name;
15010 15092
15011 String toString(); 15093 String toString();
15012 } 15094 }
15013 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15095 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15014 // for details. All rights reserved. Use of this source code is governed by a 15096 // for details. All rights reserved. Use of this source code is governed by a
15015 // BSD-style license that can be found in the LICENSE file. 15097 // BSD-style license that can be found in the LICENSE file.
15016 15098
15017 // WARNING: Do not edit - generated code. 15099 // WARNING: Do not edit - generated code.
15018 15100
15019 interface FileList { 15101 interface FileList extends List<File> {
15020 15102
15021 final int length; 15103 final int length;
15022 15104
15023 File item(int index); 15105 File item(int index);
15024 } 15106 }
15025 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15107 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15026 // for details. All rights reserved. Use of this source code is governed by a 15108 // for details. All rights reserved. Use of this source code is governed by a
15027 // BSD-style license that can be found in the LICENSE file. 15109 // BSD-style license that can be found in the LICENSE file.
15028 15110
15029 // WARNING: Do not edit - generated code. 15111 // WARNING: Do not edit - generated code.
(...skipping 10264 matching lines...) Expand 10 before | Expand all | Expand 10 after
25294 if (length < 0) throw new IllegalArgumentException('length'); 25376 if (length < 0) throw new IllegalArgumentException('length');
25295 if (start < 0) throw new IndexOutOfRangeException(start); 25377 if (start < 0) throw new IndexOutOfRangeException(start);
25296 int end = start + length; 25378 int end = start + length;
25297 if (end > a.length) throw new IndexOutOfRangeException(end); 25379 if (end > a.length) throw new IndexOutOfRangeException(end);
25298 for (int i = start; i < end; i++) { 25380 for (int i = start; i < end; i++) {
25299 accumulator.add(a[i]); 25381 accumulator.add(a[i]);
25300 } 25382 }
25301 return accumulator; 25383 return accumulator;
25302 } 25384 }
25303 } 25385 }
OLDNEW
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/dom/idl/dart/dart.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698