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

Side by Side Diff: client/dom/generated/src/frog/MediaList.dart

Issue 9113061: Reapply r3590 with frog fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 8 years, 11 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
OLDNEW
1 1
2 class MediaListJs extends DOMTypeJs implements MediaList native "*MediaList" { 2 class MediaListJs extends DOMTypeJs implements MediaList native "*MediaList" {
3 3
4 int get length() native "return this.length;"; 4 int get length() native "return this.length;";
5 5
6 String get mediaText() native "return this.mediaText;"; 6 String get mediaText() native "return this.mediaText;";
7 7
8 void set mediaText(String value) native "this.mediaText = value;"; 8 void set mediaText(String value) native "this.mediaText = value;";
9 9
10 String operator[](int index) native; 10 String operator[](int index) native "return this[index];";
11 11
12 void operator[]=(int index, String value) { 12 void operator[]=(int index, String value) {
13 throw new UnsupportedOperationException("Cannot assign element of immutable List."); 13 throw new UnsupportedOperationException("Cannot assign element of immutable List.");
14 } 14 }
15 // -- start List<String> mixins.
16 // String is the element type.
17
18 // From Iterable<String>:
19
20 Iterator<String> iterator() {
21 // Note: NodeLists are not fixed size. And most probably length shouldn't
22 // be cached in both iterator _and_ forEach method. For now caching it
23 // for consistency.
24 return new _FixedSizeListIterator<String>(this);
25 }
26
27 // From Collection<String>:
28
29 void add(String value) {
30 throw new UnsupportedOperationException("Cannot add to immutable List.");
31 }
32
33 void addLast(String value) {
34 throw new UnsupportedOperationException("Cannot add to immutable List.");
35 }
36
37 void addAll(Collection<String> collection) {
38 throw new UnsupportedOperationException("Cannot add to immutable List.");
39 }
40
41 void forEach(void f(String element)) => _Collections.forEach(this, f);
42
43 Collection map(f(String element)) => _Collections.map(this, [], f);
44
45 Collection<String> filter(bool f(String element)) =>
46 _Collections.filter(this, <String>[], f);
47
48 bool every(bool f(String element)) => _Collections.every(this, f);
49
50 bool some(bool f(String element)) => _Collections.some(this, f);
51
52 bool isEmpty() => this.length == 0;
53
54 // From List<String>:
55
56 void sort(int compare(String a, String b)) {
57 throw new UnsupportedOperationException("Cannot sort immutable List.");
58 }
59
60 int indexOf(String element, [int start = 0]) =>
61 _Lists.indexOf(this, element, start, this.length);
62
63 int lastIndexOf(String element, [int start = 0]) =>
64 _Lists.lastIndexOf(this, element, start);
65
66 String last() => this[length - 1];
67
68 // FIXME: implement thesee.
69 void setRange(int start, int length, List<String> from, [int startFrom]) {
70 throw new UnsupportedOperationException("Cannot setRange on immutable List." );
71 }
72 void removeRange(int start, int length) {
73 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis t.");
74 }
75 void insertRange(int start, int length, [String initialValue]) {
76 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis t.");
77 }
78 List<String> getRange(int start, int length) =>
79 _Lists.getRange(this, start, length, <String>[]);
80
81 // -- end List<String> mixins.
15 82
16 void appendMedium(String newMedium) native; 83 void appendMedium(String newMedium) native;
17 84
18 void deleteMedium(String oldMedium) native; 85 void deleteMedium(String oldMedium) native;
19 86
20 String item(int index) native; 87 String item(int index) native;
21 } 88 }
OLDNEW
« no previous file with comments | « client/dom/generated/src/frog/Int8Array.dart ('k') | client/dom/generated/src/frog/NamedNodeMap.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698