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

Unified Diff: lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
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:
Download patch
« no previous file with comments | « lib/dom/idl/dart/dart.idl ('k') | lib/html/frog/html_frog.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/dartium/html_dartium.dart
diff --git a/lib/html/dartium/html_dartium.dart b/lib/html/dartium/html_dartium.dart
index 677b7706232467ba05b480190dbb4ba87ea6247d..1b8c4e42c662de3faa405572a80817205e77c1e7 100644
--- a/lib/html/dartium/html_dartium.dart
+++ b/lib/html/dartium/html_dartium.dart
@@ -9269,6 +9269,88 @@ class _FileListImpl extends _DOMTypeBase implements FileList {
int get length() => _wrap(_ptr.length);
+ File operator[](int index) => _wrap(_ptr[index]);
+
+ void operator[]=(int index, File value) {
+ throw new UnsupportedOperationException("Cannot assign element of immutable List.");
+ }
+ // -- start List<File> mixins.
+ // File is the element type.
+
+ // From Iterable<File>:
+
+ Iterator<File> iterator() {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new _FixedSizeListIterator<File>(this);
+ }
+
+ // From Collection<File>:
+
+ void add(File value) {
+ throw new UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void addLast(File value) {
+ throw new UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void addAll(Collection<File> collection) {
+ throw new UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void forEach(void f(File element)) => _Collections.forEach(this, f);
+
+ Collection map(f(File element)) => _Collections.map(this, [], f);
+
+ Collection<File> filter(bool f(File element)) =>
+ _Collections.filter(this, <File>[], f);
+
+ bool every(bool f(File element)) => _Collections.every(this, f);
+
+ bool some(bool f(File element)) => _Collections.some(this, f);
+
+ bool isEmpty() => this.length == 0;
+
+ // From List<File>:
+
+ void sort(int compare(File a, File b)) {
+ throw new UnsupportedOperationException("Cannot sort immutable List.");
+ }
+
+ int indexOf(File element, [int start = 0]) =>
+ _Lists.indexOf(this, element, start, this.length);
+
+ int lastIndexOf(File element, [int start]) {
+ if (start === null) start = length - 1;
+ return _Lists.lastIndexOf(this, element, start);
+ }
+
+ File last() => this[length - 1];
+
+ File removeLast() {
+ throw new UnsupportedOperationException("Cannot removeLast on immutable List.");
+ }
+
+ // FIXME: implement these.
+ void setRange(int start, int rangeLength, List<File> from, [int startFrom]) {
+ throw new UnsupportedOperationException("Cannot setRange on immutable List.");
+ }
+
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedOperationException("Cannot removeRange on immutable List.");
+ }
+
+ void insertRange(int start, int rangeLength, [File initialValue]) {
+ throw new UnsupportedOperationException("Cannot insertRange on immutable List.");
+ }
+
+ List<File> getRange(int start, int rangeLength) =>
+ _Lists.getRange(this, start, rangeLength, <File>[]);
+
+ // -- end List<File> mixins.
+
File item(int index) {
return _wrap(_ptr.item(_unwrap(index)));
}
@@ -28998,7 +29080,7 @@ interface FileException {
// WARNING: Do not edit - generated code.
/// @domName FileList
-interface FileList {
+interface FileList extends List<File> {
/** @domName FileList.length */
final int length;
« no previous file with comments | « lib/dom/idl/dart/dart.idl ('k') | lib/html/frog/html_frog.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698