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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11410086: Use iterator, moveNext(), current. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Address comments. Created 8 years, 1 month 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 library html; 1 library html;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:isolate'; 4 import 'dart:isolate';
5 import 'dart:json'; 5 import 'dart:json';
6 import 'dart:svg' as svg; 6 import 'dart:svg' as svg;
7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
8 // for details. All rights reserved. Use of this source code is governed by a 8 // for details. All rights reserved. Use of this source code is governed by a
9 // BSD-style license that can be found in the LICENSE file. 9 // BSD-style license that can be found in the LICENSE file.
10 10
(...skipping 5293 matching lines...) Expand 10 before | Expand all | Expand 10 after
5304 DOMMimeType operator[](int index) => JS("DOMMimeType", "#[#]", this, index); 5304 DOMMimeType operator[](int index) => JS("DOMMimeType", "#[#]", this, index);
5305 5305
5306 void operator[]=(int index, DOMMimeType value) { 5306 void operator[]=(int index, DOMMimeType value) {
5307 throw new UnsupportedError("Cannot assign element of immutable List."); 5307 throw new UnsupportedError("Cannot assign element of immutable List.");
5308 } 5308 }
5309 // -- start List<DOMMimeType> mixins. 5309 // -- start List<DOMMimeType> mixins.
5310 // DOMMimeType is the element type. 5310 // DOMMimeType is the element type.
5311 5311
5312 // From Iterable<DOMMimeType>: 5312 // From Iterable<DOMMimeType>:
5313 5313
5314 Iterator<DOMMimeType> iterator() { 5314 Iterator<DOMMimeType> get iterator {
5315 // Note: NodeLists are not fixed size. And most probably length shouldn't 5315 // Note: NodeLists are not fixed size. And most probably length shouldn't
5316 // be cached in both iterator _and_ forEach method. For now caching it 5316 // be cached in both iterator _and_ forEach method. For now caching it
5317 // for consistency. 5317 // for consistency.
5318 return new FixedSizeListIterator<DOMMimeType>(this); 5318 return new FixedSizeListIterator<DOMMimeType>(this);
5319 } 5319 }
5320 5320
5321 // From Collection<DOMMimeType>: 5321 // From Collection<DOMMimeType>:
5322 5322
5323 void add(DOMMimeType value) { 5323 void add(DOMMimeType value) {
5324 throw new UnsupportedError("Cannot add to immutable List."); 5324 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5443 DOMPlugin operator[](int index) => JS("DOMPlugin", "#[#]", this, index); 5443 DOMPlugin operator[](int index) => JS("DOMPlugin", "#[#]", this, index);
5444 5444
5445 void operator[]=(int index, DOMPlugin value) { 5445 void operator[]=(int index, DOMPlugin value) {
5446 throw new UnsupportedError("Cannot assign element of immutable List."); 5446 throw new UnsupportedError("Cannot assign element of immutable List.");
5447 } 5447 }
5448 // -- start List<DOMPlugin> mixins. 5448 // -- start List<DOMPlugin> mixins.
5449 // DOMPlugin is the element type. 5449 // DOMPlugin is the element type.
5450 5450
5451 // From Iterable<DOMPlugin>: 5451 // From Iterable<DOMPlugin>:
5452 5452
5453 Iterator<DOMPlugin> iterator() { 5453 Iterator<DOMPlugin> get iterator {
5454 // Note: NodeLists are not fixed size. And most probably length shouldn't 5454 // Note: NodeLists are not fixed size. And most probably length shouldn't
5455 // be cached in both iterator _and_ forEach method. For now caching it 5455 // be cached in both iterator _and_ forEach method. For now caching it
5456 // for consistency. 5456 // for consistency.
5457 return new FixedSizeListIterator<DOMPlugin>(this); 5457 return new FixedSizeListIterator<DOMPlugin>(this);
5458 } 5458 }
5459 5459
5460 // From Collection<DOMPlugin>: 5460 // From Collection<DOMPlugin>:
5461 5461
5462 void add(DOMPlugin value) { 5462 void add(DOMPlugin value) {
5463 throw new UnsupportedError("Cannot add to immutable List."); 5463 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
6795 throw new UnsupportedError(''); 6795 throw new UnsupportedError('');
6796 } 6796 }
6797 6797
6798 Element add(Element value) { 6798 Element add(Element value) {
6799 _element.$dom_appendChild(value); 6799 _element.$dom_appendChild(value);
6800 return value; 6800 return value;
6801 } 6801 }
6802 6802
6803 Element addLast(Element value) => add(value); 6803 Element addLast(Element value) => add(value);
6804 6804
6805 Iterator<Element> iterator() => _toList().iterator(); 6805 Iterator<Element> get iterator => _toList().iterator;
6806 6806
6807 void addAll(Collection<Element> collection) { 6807 void addAll(Collection<Element> collection) {
6808 for (Element element in collection) { 6808 for (Element element in collection) {
6809 _element.$dom_appendChild(element); 6809 _element.$dom_appendChild(element);
6810 } 6810 }
6811 } 6811 }
6812 6812
6813 void sort([Comparator<Element> compare = Comparable.compare]) { 6813 void sort([Comparator<Element> compare = Comparable.compare]) {
6814 throw new UnsupportedError('TODO(jacobr): should we impl?'); 6814 throw new UnsupportedError('TODO(jacobr): should we impl?');
6815 } 6815 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
6932 } 6932 }
6933 6933
6934 void add(Element value) { 6934 void add(Element value) {
6935 throw new UnsupportedError(''); 6935 throw new UnsupportedError('');
6936 } 6936 }
6937 6937
6938 void addLast(Element value) { 6938 void addLast(Element value) {
6939 throw new UnsupportedError(''); 6939 throw new UnsupportedError('');
6940 } 6940 }
6941 6941
6942 Iterator<Element> iterator() => new _FrozenElementListIterator(this); 6942 Iterator<Element> get iterator => new _FrozenElementListIterator(this);
6943 6943
6944 void addAll(Collection<Element> collection) { 6944 void addAll(Collection<Element> collection) {
6945 throw new UnsupportedError(''); 6945 throw new UnsupportedError('');
6946 } 6946 }
6947 6947
6948 void sort([Comparator<Element> compare = Comparable.compare]) { 6948 void sort([Comparator<Element> compare = Comparable.compare]) {
6949 throw new UnsupportedError(''); 6949 throw new UnsupportedError('');
6950 } 6950 }
6951 6951
6952 void setRange(int start, int rangeLength, List from, [int startFrom = 0]) { 6952 void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
(...skipping 28 matching lines...) Expand all
6981 Element get last => _nodeList.last; 6981 Element get last => _nodeList.last;
6982 } 6982 }
6983 6983
6984 class _FrozenElementListIterator implements Iterator<Element> { 6984 class _FrozenElementListIterator implements Iterator<Element> {
6985 final _FrozenElementList _list; 6985 final _FrozenElementList _list;
6986 int _index = 0; 6986 int _index = 0;
6987 6987
6988 _FrozenElementListIterator(this._list); 6988 _FrozenElementListIterator(this._list);
6989 6989
6990 /** 6990 /**
6991 * Gets the next element in the iteration. Throws a 6991 * Moves to the next element. Returns true if the iterator is positioned
6992 * [StateError("No more elements")] if no element is left. 6992 * at an element. Returns false if it is positioned after the last element.
6993 */ 6993 */
6994 Element next() { 6994 bool moveNext() {
6995 if (!hasNext) { 6995 _index++;
6996 throw new StateError("No more elements"); 6996 if (_index < _list.length) return true;
6997 } 6997 _index = _list.length;
6998 6998 return false;
6999 return _list[_index++];
7000 } 6999 }
7001 7000
7002 /** 7001 /**
7003 * Returns whether the [Iterator] has elements left. 7002 * Returns the element the [Iterator] is positioned at.
7003 *
7004 * Throws a [StateError] if the iterator is positioned before the first, or
7005 * after the last element.
7004 */ 7006 */
7005 bool get hasNext => _index < _list.length; 7007 bool get current {
7008 if (0 <= _index && _index < _list.length) {
7009 return _list[_index];
7010 }
7011 // TODO(floitsch): adapt the error message.
7012 throw new StateError("No more elements");
7013 }
7006 } 7014 }
7007 7015
7008 /** 7016 /**
7009 * All your attribute manipulation needs in one place. 7017 * All your attribute manipulation needs in one place.
7010 * Extends the regular Map interface by automatically coercing non-string 7018 * Extends the regular Map interface by automatically coercing non-string
7011 * values to strings. 7019 * values to strings.
7012 */ 7020 */
7013 abstract class AttributeMap implements Map<String, String> { 7021 abstract class AttributeMap implements Map<String, String> {
7014 void operator []=(String key, value); 7022 void operator []=(String key, value);
7015 } 7023 }
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
8588 final int length; 8596 final int length;
8589 8597
8590 num operator[](int index) => JS("num", "#[#]", this, index); 8598 num operator[](int index) => JS("num", "#[#]", this, index);
8591 8599
8592 void operator[]=(int index, num value) => JS("void", "#[#] = #", this, index, value); 8600 void operator[]=(int index, num value) => JS("void", "#[#] = #", this, index, value);
8593 // -- start List<num> mixins. 8601 // -- start List<num> mixins.
8594 // num is the element type. 8602 // num is the element type.
8595 8603
8596 // From Iterable<num>: 8604 // From Iterable<num>:
8597 8605
8598 Iterator<num> iterator() { 8606 Iterator<num> get iterator {
8599 // Note: NodeLists are not fixed size. And most probably length shouldn't 8607 // Note: NodeLists are not fixed size. And most probably length shouldn't
8600 // be cached in both iterator _and_ forEach method. For now caching it 8608 // be cached in both iterator _and_ forEach method. For now caching it
8601 // for consistency. 8609 // for consistency.
8602 return new FixedSizeListIterator<num>(this); 8610 return new FixedSizeListIterator<num>(this);
8603 } 8611 }
8604 8612
8605 // From Collection<num>: 8613 // From Collection<num>:
8606 8614
8607 void add(num value) { 8615 void add(num value) {
8608 throw new UnsupportedError("Cannot add to immutable List."); 8616 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
8697 final int length; 8705 final int length;
8698 8706
8699 num operator[](int index) => JS("num", "#[#]", this, index); 8707 num operator[](int index) => JS("num", "#[#]", this, index);
8700 8708
8701 void operator[]=(int index, num value) => JS("void", "#[#] = #", this, index, value); 8709 void operator[]=(int index, num value) => JS("void", "#[#] = #", this, index, value);
8702 // -- start List<num> mixins. 8710 // -- start List<num> mixins.
8703 // num is the element type. 8711 // num is the element type.
8704 8712
8705 // From Iterable<num>: 8713 // From Iterable<num>:
8706 8714
8707 Iterator<num> iterator() { 8715 Iterator<num> get iterator {
8708 // Note: NodeLists are not fixed size. And most probably length shouldn't 8716 // Note: NodeLists are not fixed size. And most probably length shouldn't
8709 // be cached in both iterator _and_ forEach method. For now caching it 8717 // be cached in both iterator _and_ forEach method. For now caching it
8710 // for consistency. 8718 // for consistency.
8711 return new FixedSizeListIterator<num>(this); 8719 return new FixedSizeListIterator<num>(this);
8712 } 8720 }
8713 8721
8714 // From Collection<num>: 8722 // From Collection<num>:
8715 8723
8716 void add(num value) { 8724 void add(num value) {
8717 throw new UnsupportedError("Cannot add to immutable List."); 8725 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
9063 Node operator[](int index) => JS("Node", "#[#]", this, index); 9071 Node operator[](int index) => JS("Node", "#[#]", this, index);
9064 9072
9065 void operator[]=(int index, Node value) { 9073 void operator[]=(int index, Node value) {
9066 throw new UnsupportedError("Cannot assign element of immutable List."); 9074 throw new UnsupportedError("Cannot assign element of immutable List.");
9067 } 9075 }
9068 // -- start List<Node> mixins. 9076 // -- start List<Node> mixins.
9069 // Node is the element type. 9077 // Node is the element type.
9070 9078
9071 // From Iterable<Node>: 9079 // From Iterable<Node>:
9072 9080
9073 Iterator<Node> iterator() { 9081 Iterator<Node> get iterator {
9074 // Note: NodeLists are not fixed size. And most probably length shouldn't 9082 // Note: NodeLists are not fixed size. And most probably length shouldn't
9075 // be cached in both iterator _and_ forEach method. For now caching it 9083 // be cached in both iterator _and_ forEach method. For now caching it
9076 // for consistency. 9084 // for consistency.
9077 return new FixedSizeListIterator<Node>(this); 9085 return new FixedSizeListIterator<Node>(this);
9078 } 9086 }
9079 9087
9080 // From Collection<Node>: 9088 // From Collection<Node>:
9081 9089
9082 void add(Node value) { 9090 void add(Node value) {
9083 throw new UnsupportedError("Cannot add to immutable List."); 9091 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
9166 Node operator[](int index) => JS("Node", "#[#]", this, index); 9174 Node operator[](int index) => JS("Node", "#[#]", this, index);
9167 9175
9168 void operator[]=(int index, Node value) { 9176 void operator[]=(int index, Node value) {
9169 throw new UnsupportedError("Cannot assign element of immutable List."); 9177 throw new UnsupportedError("Cannot assign element of immutable List.");
9170 } 9178 }
9171 // -- start List<Node> mixins. 9179 // -- start List<Node> mixins.
9172 // Node is the element type. 9180 // Node is the element type.
9173 9181
9174 // From Iterable<Node>: 9182 // From Iterable<Node>:
9175 9183
9176 Iterator<Node> iterator() { 9184 Iterator<Node> get iterator {
9177 // Note: NodeLists are not fixed size. And most probably length shouldn't 9185 // Note: NodeLists are not fixed size. And most probably length shouldn't
9178 // be cached in both iterator _and_ forEach method. For now caching it 9186 // be cached in both iterator _and_ forEach method. For now caching it
9179 // for consistency. 9187 // for consistency.
9180 return new FixedSizeListIterator<Node>(this); 9188 return new FixedSizeListIterator<Node>(this);
9181 } 9189 }
9182 9190
9183 // From Collection<Node>: 9191 // From Collection<Node>:
9184 9192
9185 void add(Node value) { 9193 void add(Node value) {
9186 throw new UnsupportedError("Cannot add to immutable List."); 9194 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
10734 final int length; 10742 final int length;
10735 10743
10736 int operator[](int index) => JS("int", "#[#]", this, index); 10744 int operator[](int index) => JS("int", "#[#]", this, index);
10737 10745
10738 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value); 10746 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
10739 // -- start List<int> mixins. 10747 // -- start List<int> mixins.
10740 // int is the element type. 10748 // int is the element type.
10741 10749
10742 // From Iterable<int>: 10750 // From Iterable<int>:
10743 10751
10744 Iterator<int> iterator() { 10752 Iterator<int> get iterator {
10745 // Note: NodeLists are not fixed size. And most probably length shouldn't 10753 // Note: NodeLists are not fixed size. And most probably length shouldn't
10746 // be cached in both iterator _and_ forEach method. For now caching it 10754 // be cached in both iterator _and_ forEach method. For now caching it
10747 // for consistency. 10755 // for consistency.
10748 return new FixedSizeListIterator<int>(this); 10756 return new FixedSizeListIterator<int>(this);
10749 } 10757 }
10750 10758
10751 // From Collection<int>: 10759 // From Collection<int>:
10752 10760
10753 void add(int value) { 10761 void add(int value) {
10754 throw new UnsupportedError("Cannot add to immutable List."); 10762 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
10843 final int length; 10851 final int length;
10844 10852
10845 int operator[](int index) => JS("int", "#[#]", this, index); 10853 int operator[](int index) => JS("int", "#[#]", this, index);
10846 10854
10847 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value); 10855 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
10848 // -- start List<int> mixins. 10856 // -- start List<int> mixins.
10849 // int is the element type. 10857 // int is the element type.
10850 10858
10851 // From Iterable<int>: 10859 // From Iterable<int>:
10852 10860
10853 Iterator<int> iterator() { 10861 Iterator<int> get iterator {
10854 // Note: NodeLists are not fixed size. And most probably length shouldn't 10862 // Note: NodeLists are not fixed size. And most probably length shouldn't
10855 // be cached in both iterator _and_ forEach method. For now caching it 10863 // be cached in both iterator _and_ forEach method. For now caching it
10856 // for consistency. 10864 // for consistency.
10857 return new FixedSizeListIterator<int>(this); 10865 return new FixedSizeListIterator<int>(this);
10858 } 10866 }
10859 10867
10860 // From Collection<int>: 10868 // From Collection<int>:
10861 10869
10862 void add(int value) { 10870 void add(int value) {
10863 throw new UnsupportedError("Cannot add to immutable List."); 10871 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
10952 final int length; 10960 final int length;
10953 10961
10954 int operator[](int index) => JS("int", "#[#]", this, index); 10962 int operator[](int index) => JS("int", "#[#]", this, index);
10955 10963
10956 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value); 10964 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
10957 // -- start List<int> mixins. 10965 // -- start List<int> mixins.
10958 // int is the element type. 10966 // int is the element type.
10959 10967
10960 // From Iterable<int>: 10968 // From Iterable<int>:
10961 10969
10962 Iterator<int> iterator() { 10970 Iterator<int> get iterator {
10963 // Note: NodeLists are not fixed size. And most probably length shouldn't 10971 // Note: NodeLists are not fixed size. And most probably length shouldn't
10964 // be cached in both iterator _and_ forEach method. For now caching it 10972 // be cached in both iterator _and_ forEach method. For now caching it
10965 // for consistency. 10973 // for consistency.
10966 return new FixedSizeListIterator<int>(this); 10974 return new FixedSizeListIterator<int>(this);
10967 } 10975 }
10968 10976
10969 // From Collection<int>: 10977 // From Collection<int>:
10970 10978
10971 void add(int value) { 10979 void add(int value) {
10972 throw new UnsupportedError("Cannot add to immutable List."); 10980 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
13102 Node operator[](int index) => JS("Node", "#[#]", this, index); 13110 Node operator[](int index) => JS("Node", "#[#]", this, index);
13103 13111
13104 void operator[]=(int index, Node value) { 13112 void operator[]=(int index, Node value) {
13105 throw new UnsupportedError("Cannot assign element of immutable List."); 13113 throw new UnsupportedError("Cannot assign element of immutable List.");
13106 } 13114 }
13107 // -- start List<Node> mixins. 13115 // -- start List<Node> mixins.
13108 // Node is the element type. 13116 // Node is the element type.
13109 13117
13110 // From Iterable<Node>: 13118 // From Iterable<Node>:
13111 13119
13112 Iterator<Node> iterator() { 13120 Iterator<Node> get iterator {
13113 // Note: NodeLists are not fixed size. And most probably length shouldn't 13121 // Note: NodeLists are not fixed size. And most probably length shouldn't
13114 // be cached in both iterator _and_ forEach method. For now caching it 13122 // be cached in both iterator _and_ forEach method. For now caching it
13115 // for consistency. 13123 // for consistency.
13116 return new FixedSizeListIterator<Node>(this); 13124 return new FixedSizeListIterator<Node>(this);
13117 } 13125 }
13118 13126
13119 // From Collection<Node>: 13127 // From Collection<Node>:
13120 13128
13121 void add(Node value) { 13129 void add(Node value) {
13122 throw new UnsupportedError("Cannot add to immutable List."); 13130 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
13354 } 13362 }
13355 13363
13356 void clear() { 13364 void clear() {
13357 _this.text = ''; 13365 _this.text = '';
13358 } 13366 }
13359 13367
13360 void operator []=(int index, Node value) { 13368 void operator []=(int index, Node value) {
13361 _this.$dom_replaceChild(value, this[index]); 13369 _this.$dom_replaceChild(value, this[index]);
13362 } 13370 }
13363 13371
13364 Iterator<Node> iterator() => _this.$dom_childNodes.iterator(); 13372 Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
13365 13373
13366 // TODO(jacobr): We can implement these methods much more efficiently by 13374 // TODO(jacobr): We can implement these methods much more efficiently by
13367 // looking up the nodeList only once instead of once per iteration. 13375 // looking up the nodeList only once instead of once per iteration.
13368 bool contains(Node element) => _Collections.contains(this, element); 13376 bool contains(Node element) => _Collections.contains(this, element);
13369 13377
13370 void forEach(void f(Node element)) => _Collections.forEach(this, f); 13378 void forEach(void f(Node element)) => _Collections.forEach(this, f);
13371 13379
13372 Collection map(f(Node element)) => _Collections.map(this, [], f); 13380 Collection map(f(Node element)) => _Collections.map(this, [], f);
13373 13381
13374 Collection<Node> filter(bool f(Node element)) => 13382 Collection<Node> filter(bool f(Node element)) =>
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
13647 // BSD-style license that can be found in the LICENSE file. 13655 // BSD-style license that can be found in the LICENSE file.
13648 13656
13649 13657
13650 // TODO(nweiz): when all implementations we target have the same name for the 13658 // TODO(nweiz): when all implementations we target have the same name for the
13651 // implementation of List<E>, extend that rather than wrapping. 13659 // implementation of List<E>, extend that rather than wrapping.
13652 class _ListWrapper<E> implements List<E> { 13660 class _ListWrapper<E> implements List<E> {
13653 List _list; 13661 List _list;
13654 13662
13655 _ListWrapper(List this._list); 13663 _ListWrapper(List this._list);
13656 13664
13657 Iterator<E> iterator() => _list.iterator(); 13665 Iterator<E> get iterator => _list.iterator;
13658 13666
13659 bool contains(E element) => _list.contains(element); 13667 bool contains(E element) => _list.contains(element);
13660 13668
13661 void forEach(void f(E element)) => _list.forEach(f); 13669 void forEach(void f(E element)) => _list.forEach(f);
13662 13670
13663 Collection map(f(E element)) => _list.map(f); 13671 Collection map(f(E element)) => _list.map(f);
13664 13672
13665 List<E> filter(bool f(E element)) => _list.filter(f); 13673 List<E> filter(bool f(E element)) => _list.filter(f);
13666 13674
13667 bool every(bool f(E element)) => _list.every(f); 13675 bool every(bool f(E element)) => _list.every(f);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
13727 } 13735 }
13728 13736
13729 class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi st" { 13737 class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi st" {
13730 Node _parent; 13738 Node _parent;
13731 13739
13732 // -- start List<Node> mixins. 13740 // -- start List<Node> mixins.
13733 // Node is the element type. 13741 // Node is the element type.
13734 13742
13735 // From Iterable<Node>: 13743 // From Iterable<Node>:
13736 13744
13737 Iterator<Node> iterator() { 13745 Iterator<Node> get iterator {
13738 // Note: NodeLists are not fixed size. And most probably length shouldn't 13746 // Note: NodeLists are not fixed size. And most probably length shouldn't
13739 // be cached in both iterator _and_ forEach method. For now caching it 13747 // be cached in both iterator _and_ forEach method. For now caching it
13740 // for consistency. 13748 // for consistency.
13741 return new FixedSizeListIterator<Node>(this); 13749 return new FixedSizeListIterator<Node>(this);
13742 } 13750 }
13743 13751
13744 // From Collection<Node>: 13752 // From Collection<Node>:
13745 13753
13746 void add(Node value) { 13754 void add(Node value) {
13747 _parent.$dom_appendChild(value); 13755 _parent.$dom_appendChild(value);
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after
15418 Map operator[](int index) => JS("Map", "#[#]", this, index); 15426 Map operator[](int index) => JS("Map", "#[#]", this, index);
15419 15427
15420 void operator[]=(int index, Map value) { 15428 void operator[]=(int index, Map value) {
15421 throw new UnsupportedError("Cannot assign element of immutable List."); 15429 throw new UnsupportedError("Cannot assign element of immutable List.");
15422 } 15430 }
15423 // -- start List<Map> mixins. 15431 // -- start List<Map> mixins.
15424 // Map is the element type. 15432 // Map is the element type.
15425 15433
15426 // From Iterable<Map>: 15434 // From Iterable<Map>:
15427 15435
15428 Iterator<Map> iterator() { 15436 Iterator<Map> get iterator {
15429 // Note: NodeLists are not fixed size. And most probably length shouldn't 15437 // Note: NodeLists are not fixed size. And most probably length shouldn't
15430 // be cached in both iterator _and_ forEach method. For now caching it 15438 // be cached in both iterator _and_ forEach method. For now caching it
15431 // for consistency. 15439 // for consistency.
15432 return new FixedSizeListIterator<Map>(this); 15440 return new FixedSizeListIterator<Map>(this);
15433 } 15441 }
15434 15442
15435 // From Collection<Map>: 15443 // From Collection<Map>:
15436 15444
15437 void add(Map value) { 15445 void add(Map value) {
15438 throw new UnsupportedError("Cannot add to immutable List."); 15446 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
15932 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index); 15940 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index);
15933 15941
15934 void operator[]=(int index, SourceBuffer value) { 15942 void operator[]=(int index, SourceBuffer value) {
15935 throw new UnsupportedError("Cannot assign element of immutable List."); 15943 throw new UnsupportedError("Cannot assign element of immutable List.");
15936 } 15944 }
15937 // -- start List<SourceBuffer> mixins. 15945 // -- start List<SourceBuffer> mixins.
15938 // SourceBuffer is the element type. 15946 // SourceBuffer is the element type.
15939 15947
15940 // From Iterable<SourceBuffer>: 15948 // From Iterable<SourceBuffer>:
15941 15949
15942 Iterator<SourceBuffer> iterator() { 15950 Iterator<SourceBuffer> get iterator {
15943 // Note: NodeLists are not fixed size. And most probably length shouldn't 15951 // Note: NodeLists are not fixed size. And most probably length shouldn't
15944 // be cached in both iterator _and_ forEach method. For now caching it 15952 // be cached in both iterator _and_ forEach method. For now caching it
15945 // for consistency. 15953 // for consistency.
15946 return new FixedSizeListIterator<SourceBuffer>(this); 15954 return new FixedSizeListIterator<SourceBuffer>(this);
15947 } 15955 }
15948 15956
15949 // From Collection<SourceBuffer>: 15957 // From Collection<SourceBuffer>:
15950 15958
15951 void add(SourceBuffer value) { 15959 void add(SourceBuffer value) {
15952 throw new UnsupportedError("Cannot add to immutable List."); 15960 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
16085 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index ); 16093 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index );
16086 16094
16087 void operator[]=(int index, SpeechGrammar value) { 16095 void operator[]=(int index, SpeechGrammar value) {
16088 throw new UnsupportedError("Cannot assign element of immutable List."); 16096 throw new UnsupportedError("Cannot assign element of immutable List.");
16089 } 16097 }
16090 // -- start List<SpeechGrammar> mixins. 16098 // -- start List<SpeechGrammar> mixins.
16091 // SpeechGrammar is the element type. 16099 // SpeechGrammar is the element type.
16092 16100
16093 // From Iterable<SpeechGrammar>: 16101 // From Iterable<SpeechGrammar>:
16094 16102
16095 Iterator<SpeechGrammar> iterator() { 16103 Iterator<SpeechGrammar> get iterator {
16096 // Note: NodeLists are not fixed size. And most probably length shouldn't 16104 // Note: NodeLists are not fixed size. And most probably length shouldn't
16097 // be cached in both iterator _and_ forEach method. For now caching it 16105 // be cached in both iterator _and_ forEach method. For now caching it
16098 // for consistency. 16106 // for consistency.
16099 return new FixedSizeListIterator<SpeechGrammar>(this); 16107 return new FixedSizeListIterator<SpeechGrammar>(this);
16100 } 16108 }
16101 16109
16102 // From Collection<SpeechGrammar>: 16110 // From Collection<SpeechGrammar>:
16103 16111
16104 void add(SpeechGrammar value) { 16112 void add(SpeechGrammar value) {
16105 throw new UnsupportedError("Cannot add to immutable List."); 16113 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
17104 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index); 17112 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index);
17105 17113
17106 void operator[]=(int index, TextTrackCue value) { 17114 void operator[]=(int index, TextTrackCue value) {
17107 throw new UnsupportedError("Cannot assign element of immutable List."); 17115 throw new UnsupportedError("Cannot assign element of immutable List.");
17108 } 17116 }
17109 // -- start List<TextTrackCue> mixins. 17117 // -- start List<TextTrackCue> mixins.
17110 // TextTrackCue is the element type. 17118 // TextTrackCue is the element type.
17111 17119
17112 // From Iterable<TextTrackCue>: 17120 // From Iterable<TextTrackCue>:
17113 17121
17114 Iterator<TextTrackCue> iterator() { 17122 Iterator<TextTrackCue> get iterator {
17115 // Note: NodeLists are not fixed size. And most probably length shouldn't 17123 // Note: NodeLists are not fixed size. And most probably length shouldn't
17116 // be cached in both iterator _and_ forEach method. For now caching it 17124 // be cached in both iterator _and_ forEach method. For now caching it
17117 // for consistency. 17125 // for consistency.
17118 return new FixedSizeListIterator<TextTrackCue>(this); 17126 return new FixedSizeListIterator<TextTrackCue>(this);
17119 } 17127 }
17120 17128
17121 // From Collection<TextTrackCue>: 17129 // From Collection<TextTrackCue>:
17122 17130
17123 void add(TextTrackCue value) { 17131 void add(TextTrackCue value) {
17124 throw new UnsupportedError("Cannot add to immutable List."); 17132 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
17210 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index); 17218 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index);
17211 17219
17212 void operator[]=(int index, TextTrack value) { 17220 void operator[]=(int index, TextTrack value) {
17213 throw new UnsupportedError("Cannot assign element of immutable List."); 17221 throw new UnsupportedError("Cannot assign element of immutable List.");
17214 } 17222 }
17215 // -- start List<TextTrack> mixins. 17223 // -- start List<TextTrack> mixins.
17216 // TextTrack is the element type. 17224 // TextTrack is the element type.
17217 17225
17218 // From Iterable<TextTrack>: 17226 // From Iterable<TextTrack>:
17219 17227
17220 Iterator<TextTrack> iterator() { 17228 Iterator<TextTrack> get iterator {
17221 // Note: NodeLists are not fixed size. And most probably length shouldn't 17229 // Note: NodeLists are not fixed size. And most probably length shouldn't
17222 // be cached in both iterator _and_ forEach method. For now caching it 17230 // be cached in both iterator _and_ forEach method. For now caching it
17223 // for consistency. 17231 // for consistency.
17224 return new FixedSizeListIterator<TextTrack>(this); 17232 return new FixedSizeListIterator<TextTrack>(this);
17225 } 17233 }
17226 17234
17227 // From Collection<TextTrack>: 17235 // From Collection<TextTrack>:
17228 17236
17229 void add(TextTrack value) { 17237 void add(TextTrack value) {
17230 throw new UnsupportedError("Cannot add to immutable List."); 17238 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
17434 Touch operator[](int index) => JS("Touch", "#[#]", this, index); 17442 Touch operator[](int index) => JS("Touch", "#[#]", this, index);
17435 17443
17436 void operator[]=(int index, Touch value) { 17444 void operator[]=(int index, Touch value) {
17437 throw new UnsupportedError("Cannot assign element of immutable List."); 17445 throw new UnsupportedError("Cannot assign element of immutable List.");
17438 } 17446 }
17439 // -- start List<Touch> mixins. 17447 // -- start List<Touch> mixins.
17440 // Touch is the element type. 17448 // Touch is the element type.
17441 17449
17442 // From Iterable<Touch>: 17450 // From Iterable<Touch>:
17443 17451
17444 Iterator<Touch> iterator() { 17452 Iterator<Touch> get iterator {
17445 // Note: NodeLists are not fixed size. And most probably length shouldn't 17453 // Note: NodeLists are not fixed size. And most probably length shouldn't
17446 // be cached in both iterator _and_ forEach method. For now caching it 17454 // be cached in both iterator _and_ forEach method. For now caching it
17447 // for consistency. 17455 // for consistency.
17448 return new FixedSizeListIterator<Touch>(this); 17456 return new FixedSizeListIterator<Touch>(this);
17449 } 17457 }
17450 17458
17451 // From Collection<Touch>: 17459 // From Collection<Touch>:
17452 17460
17453 void add(Touch value) { 17461 void add(Touch value) {
17454 throw new UnsupportedError("Cannot add to immutable List."); 17462 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
17708 final int length; 17716 final int length;
17709 17717
17710 int operator[](int index) => JS("int", "#[#]", this, index); 17718 int operator[](int index) => JS("int", "#[#]", this, index);
17711 17719
17712 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value); 17720 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
17713 // -- start List<int> mixins. 17721 // -- start List<int> mixins.
17714 // int is the element type. 17722 // int is the element type.
17715 17723
17716 // From Iterable<int>: 17724 // From Iterable<int>:
17717 17725
17718 Iterator<int> iterator() { 17726 Iterator<int> get iterator {
17719 // Note: NodeLists are not fixed size. And most probably length shouldn't 17727 // Note: NodeLists are not fixed size. And most probably length shouldn't
17720 // be cached in both iterator _and_ forEach method. For now caching it 17728 // be cached in both iterator _and_ forEach method. For now caching it
17721 // for consistency. 17729 // for consistency.
17722 return new FixedSizeListIterator<int>(this); 17730 return new FixedSizeListIterator<int>(this);
17723 } 17731 }
17724 17732
17725 // From Collection<int>: 17733 // From Collection<int>:
17726 17734
17727 void add(int value) { 17735 void add(int value) {
17728 throw new UnsupportedError("Cannot add to immutable List."); 17736 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
17817 final int length; 17825 final int length;
17818 17826
17819 int operator[](int index) => JS("int", "#[#]", this, index); 17827 int operator[](int index) => JS("int", "#[#]", this, index);
17820 17828
17821 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value); 17829 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
17822 // -- start List<int> mixins. 17830 // -- start List<int> mixins.
17823 // int is the element type. 17831 // int is the element type.
17824 17832
17825 // From Iterable<int>: 17833 // From Iterable<int>:
17826 17834
17827 Iterator<int> iterator() { 17835 Iterator<int> get iterator {
17828 // Note: NodeLists are not fixed size. And most probably length shouldn't 17836 // Note: NodeLists are not fixed size. And most probably length shouldn't
17829 // be cached in both iterator _and_ forEach method. For now caching it 17837 // be cached in both iterator _and_ forEach method. For now caching it
17830 // for consistency. 17838 // for consistency.
17831 return new FixedSizeListIterator<int>(this); 17839 return new FixedSizeListIterator<int>(this);
17832 } 17840 }
17833 17841
17834 // From Collection<int>: 17842 // From Collection<int>:
17835 17843
17836 void add(int value) { 17844 void add(int value) {
17837 throw new UnsupportedError("Cannot add to immutable List."); 17845 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
17926 final int length; 17934 final int length;
17927 17935
17928 int operator[](int index) => JS("int", "#[#]", this, index); 17936 int operator[](int index) => JS("int", "#[#]", this, index);
17929 17937
17930 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value); 17938 void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
17931 // -- start List<int> mixins. 17939 // -- start List<int> mixins.
17932 // int is the element type. 17940 // int is the element type.
17933 17941
17934 // From Iterable<int>: 17942 // From Iterable<int>:
17935 17943
17936 Iterator<int> iterator() { 17944 Iterator<int> get iterator {
17937 // Note: NodeLists are not fixed size. And most probably length shouldn't 17945 // Note: NodeLists are not fixed size. And most probably length shouldn't
17938 // be cached in both iterator _and_ forEach method. For now caching it 17946 // be cached in both iterator _and_ forEach method. For now caching it
17939 // for consistency. 17947 // for consistency.
17940 return new FixedSizeListIterator<int>(this); 17948 return new FixedSizeListIterator<int>(this);
17941 } 17949 }
17942 17950
17943 // From Collection<int>: 17951 // From Collection<int>:
17944 17952
17945 void add(int value) { 17953 void add(int value) {
17946 throw new UnsupportedError("Cannot add to immutable List."); 17954 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after
20112 CSSRule operator[](int index) => JS("CSSRule", "#[#]", this, index); 20120 CSSRule operator[](int index) => JS("CSSRule", "#[#]", this, index);
20113 20121
20114 void operator[]=(int index, CSSRule value) { 20122 void operator[]=(int index, CSSRule value) {
20115 throw new UnsupportedError("Cannot assign element of immutable List."); 20123 throw new UnsupportedError("Cannot assign element of immutable List.");
20116 } 20124 }
20117 // -- start List<CSSRule> mixins. 20125 // -- start List<CSSRule> mixins.
20118 // CSSRule is the element type. 20126 // CSSRule is the element type.
20119 20127
20120 // From Iterable<CSSRule>: 20128 // From Iterable<CSSRule>:
20121 20129
20122 Iterator<CSSRule> iterator() { 20130 Iterator<CSSRule> get iterator {
20123 // Note: NodeLists are not fixed size. And most probably length shouldn't 20131 // Note: NodeLists are not fixed size. And most probably length shouldn't
20124 // be cached in both iterator _and_ forEach method. For now caching it 20132 // be cached in both iterator _and_ forEach method. For now caching it
20125 // for consistency. 20133 // for consistency.
20126 return new FixedSizeListIterator<CSSRule>(this); 20134 return new FixedSizeListIterator<CSSRule>(this);
20127 } 20135 }
20128 20136
20129 // From Collection<CSSRule>: 20137 // From Collection<CSSRule>:
20130 20138
20131 void add(CSSRule value) { 20139 void add(CSSRule value) {
20132 throw new UnsupportedError("Cannot add to immutable List."); 20140 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
20209 CSSValue operator[](int index) => JS("CSSValue", "#[#]", this, index); 20217 CSSValue operator[](int index) => JS("CSSValue", "#[#]", this, index);
20210 20218
20211 void operator[]=(int index, CSSValue value) { 20219 void operator[]=(int index, CSSValue value) {
20212 throw new UnsupportedError("Cannot assign element of immutable List."); 20220 throw new UnsupportedError("Cannot assign element of immutable List.");
20213 } 20221 }
20214 // -- start List<CSSValue> mixins. 20222 // -- start List<CSSValue> mixins.
20215 // CSSValue is the element type. 20223 // CSSValue is the element type.
20216 20224
20217 // From Iterable<CSSValue>: 20225 // From Iterable<CSSValue>:
20218 20226
20219 Iterator<CSSValue> iterator() { 20227 Iterator<CSSValue> get iterator {
20220 // Note: NodeLists are not fixed size. And most probably length shouldn't 20228 // Note: NodeLists are not fixed size. And most probably length shouldn't
20221 // be cached in both iterator _and_ forEach method. For now caching it 20229 // be cached in both iterator _and_ forEach method. For now caching it
20222 // for consistency. 20230 // for consistency.
20223 return new FixedSizeListIterator<CSSValue>(this); 20231 return new FixedSizeListIterator<CSSValue>(this);
20224 } 20232 }
20225 20233
20226 // From Collection<CSSValue>: 20234 // From Collection<CSSValue>:
20227 20235
20228 void add(CSSValue value) { 20236 void add(CSSValue value) {
20229 throw new UnsupportedError("Cannot add to immutable List."); 20237 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
20306 ClientRect operator[](int index) => JS("ClientRect", "#[#]", this, index); 20314 ClientRect operator[](int index) => JS("ClientRect", "#[#]", this, index);
20307 20315
20308 void operator[]=(int index, ClientRect value) { 20316 void operator[]=(int index, ClientRect value) {
20309 throw new UnsupportedError("Cannot assign element of immutable List."); 20317 throw new UnsupportedError("Cannot assign element of immutable List.");
20310 } 20318 }
20311 // -- start List<ClientRect> mixins. 20319 // -- start List<ClientRect> mixins.
20312 // ClientRect is the element type. 20320 // ClientRect is the element type.
20313 20321
20314 // From Iterable<ClientRect>: 20322 // From Iterable<ClientRect>:
20315 20323
20316 Iterator<ClientRect> iterator() { 20324 Iterator<ClientRect> get iterator {
20317 // Note: NodeLists are not fixed size. And most probably length shouldn't 20325 // Note: NodeLists are not fixed size. And most probably length shouldn't
20318 // be cached in both iterator _and_ forEach method. For now caching it 20326 // be cached in both iterator _and_ forEach method. For now caching it
20319 // for consistency. 20327 // for consistency.
20320 return new FixedSizeListIterator<ClientRect>(this); 20328 return new FixedSizeListIterator<ClientRect>(this);
20321 } 20329 }
20322 20330
20323 // From Collection<ClientRect>: 20331 // From Collection<ClientRect>:
20324 20332
20325 void add(ClientRect value) { 20333 void add(ClientRect value) {
20326 throw new UnsupportedError("Cannot add to immutable List."); 20334 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
20412 String operator[](int index) => JS("String", "#[#]", this, index); 20420 String operator[](int index) => JS("String", "#[#]", this, index);
20413 20421
20414 void operator[]=(int index, String value) { 20422 void operator[]=(int index, String value) {
20415 throw new UnsupportedError("Cannot assign element of immutable List."); 20423 throw new UnsupportedError("Cannot assign element of immutable List.");
20416 } 20424 }
20417 // -- start List<String> mixins. 20425 // -- start List<String> mixins.
20418 // String is the element type. 20426 // String is the element type.
20419 20427
20420 // From Iterable<String>: 20428 // From Iterable<String>:
20421 20429
20422 Iterator<String> iterator() { 20430 Iterator<String> get iterator {
20423 // Note: NodeLists are not fixed size. And most probably length shouldn't 20431 // Note: NodeLists are not fixed size. And most probably length shouldn't
20424 // be cached in both iterator _and_ forEach method. For now caching it 20432 // be cached in both iterator _and_ forEach method. For now caching it
20425 // for consistency. 20433 // for consistency.
20426 return new FixedSizeListIterator<String>(this); 20434 return new FixedSizeListIterator<String>(this);
20427 } 20435 }
20428 20436
20429 // From Collection<String>: 20437 // From Collection<String>:
20430 20438
20431 void add(String value) { 20439 void add(String value) {
20432 throw new UnsupportedError("Cannot add to immutable List."); 20440 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
20834 Entry operator[](int index) => JS("Entry", "#[#]", this, index); 20842 Entry operator[](int index) => JS("Entry", "#[#]", this, index);
20835 20843
20836 void operator[]=(int index, Entry value) { 20844 void operator[]=(int index, Entry value) {
20837 throw new UnsupportedError("Cannot assign element of immutable List."); 20845 throw new UnsupportedError("Cannot assign element of immutable List.");
20838 } 20846 }
20839 // -- start List<Entry> mixins. 20847 // -- start List<Entry> mixins.
20840 // Entry is the element type. 20848 // Entry is the element type.
20841 20849
20842 // From Iterable<Entry>: 20850 // From Iterable<Entry>:
20843 20851
20844 Iterator<Entry> iterator() { 20852 Iterator<Entry> get iterator {
20845 // Note: NodeLists are not fixed size. And most probably length shouldn't 20853 // Note: NodeLists are not fixed size. And most probably length shouldn't
20846 // be cached in both iterator _and_ forEach method. For now caching it 20854 // be cached in both iterator _and_ forEach method. For now caching it
20847 // for consistency. 20855 // for consistency.
20848 return new FixedSizeListIterator<Entry>(this); 20856 return new FixedSizeListIterator<Entry>(this);
20849 } 20857 }
20850 20858
20851 // From Collection<Entry>: 20859 // From Collection<Entry>:
20852 20860
20853 void add(Entry value) { 20861 void add(Entry value) {
20854 throw new UnsupportedError("Cannot add to immutable List."); 20862 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
20931 EntrySync operator[](int index) => JS("EntrySync", "#[#]", this, index); 20939 EntrySync operator[](int index) => JS("EntrySync", "#[#]", this, index);
20932 20940
20933 void operator[]=(int index, EntrySync value) { 20941 void operator[]=(int index, EntrySync value) {
20934 throw new UnsupportedError("Cannot assign element of immutable List."); 20942 throw new UnsupportedError("Cannot assign element of immutable List.");
20935 } 20943 }
20936 // -- start List<EntrySync> mixins. 20944 // -- start List<EntrySync> mixins.
20937 // EntrySync is the element type. 20945 // EntrySync is the element type.
20938 20946
20939 // From Iterable<EntrySync>: 20947 // From Iterable<EntrySync>:
20940 20948
20941 Iterator<EntrySync> iterator() { 20949 Iterator<EntrySync> get iterator {
20942 // Note: NodeLists are not fixed size. And most probably length shouldn't 20950 // Note: NodeLists are not fixed size. And most probably length shouldn't
20943 // be cached in both iterator _and_ forEach method. For now caching it 20951 // be cached in both iterator _and_ forEach method. For now caching it
20944 // for consistency. 20952 // for consistency.
20945 return new FixedSizeListIterator<EntrySync>(this); 20953 return new FixedSizeListIterator<EntrySync>(this);
20946 } 20954 }
20947 20955
20948 // From Collection<EntrySync>: 20956 // From Collection<EntrySync>:
20949 20957
20950 void add(EntrySync value) { 20958 void add(EntrySync value) {
20951 throw new UnsupportedError("Cannot add to immutable List."); 20959 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
21037 File operator[](int index) => JS("File", "#[#]", this, index); 21045 File operator[](int index) => JS("File", "#[#]", this, index);
21038 21046
21039 void operator[]=(int index, File value) { 21047 void operator[]=(int index, File value) {
21040 throw new UnsupportedError("Cannot assign element of immutable List."); 21048 throw new UnsupportedError("Cannot assign element of immutable List.");
21041 } 21049 }
21042 // -- start List<File> mixins. 21050 // -- start List<File> mixins.
21043 // File is the element type. 21051 // File is the element type.
21044 21052
21045 // From Iterable<File>: 21053 // From Iterable<File>:
21046 21054
21047 Iterator<File> iterator() { 21055 Iterator<File> get iterator {
21048 // Note: NodeLists are not fixed size. And most probably length shouldn't 21056 // Note: NodeLists are not fixed size. And most probably length shouldn't
21049 // be cached in both iterator _and_ forEach method. For now caching it 21057 // be cached in both iterator _and_ forEach method. For now caching it
21050 // for consistency. 21058 // for consistency.
21051 return new FixedSizeListIterator<File>(this); 21059 return new FixedSizeListIterator<File>(this);
21052 } 21060 }
21053 21061
21054 // From Collection<File>: 21062 // From Collection<File>:
21055 21063
21056 void add(File value) { 21064 void add(File value) {
21057 throw new UnsupportedError("Cannot add to immutable List."); 21065 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
21163 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index); 21171 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index);
21164 21172
21165 void operator[]=(int index, Gamepad value) { 21173 void operator[]=(int index, Gamepad value) {
21166 throw new UnsupportedError("Cannot assign element of immutable List."); 21174 throw new UnsupportedError("Cannot assign element of immutable List.");
21167 } 21175 }
21168 // -- start List<Gamepad> mixins. 21176 // -- start List<Gamepad> mixins.
21169 // Gamepad is the element type. 21177 // Gamepad is the element type.
21170 21178
21171 // From Iterable<Gamepad>: 21179 // From Iterable<Gamepad>:
21172 21180
21173 Iterator<Gamepad> iterator() { 21181 Iterator<Gamepad> get iterator {
21174 // Note: NodeLists are not fixed size. And most probably length shouldn't 21182 // Note: NodeLists are not fixed size. And most probably length shouldn't
21175 // be cached in both iterator _and_ forEach method. For now caching it 21183 // be cached in both iterator _and_ forEach method. For now caching it
21176 // for consistency. 21184 // for consistency.
21177 return new FixedSizeListIterator<Gamepad>(this); 21185 return new FixedSizeListIterator<Gamepad>(this);
21178 } 21186 }
21179 21187
21180 // From Collection<Gamepad>: 21188 // From Collection<Gamepad>:
21181 21189
21182 void add(Gamepad value) { 21190 void add(Gamepad value) {
21183 throw new UnsupportedError("Cannot add to immutable List."); 21191 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
21313 MediaStream operator[](int index) => JS("MediaStream", "#[#]", this, index); 21321 MediaStream operator[](int index) => JS("MediaStream", "#[#]", this, index);
21314 21322
21315 void operator[]=(int index, MediaStream value) { 21323 void operator[]=(int index, MediaStream value) {
21316 throw new UnsupportedError("Cannot assign element of immutable List."); 21324 throw new UnsupportedError("Cannot assign element of immutable List.");
21317 } 21325 }
21318 // -- start List<MediaStream> mixins. 21326 // -- start List<MediaStream> mixins.
21319 // MediaStream is the element type. 21327 // MediaStream is the element type.
21320 21328
21321 // From Iterable<MediaStream>: 21329 // From Iterable<MediaStream>:
21322 21330
21323 Iterator<MediaStream> iterator() { 21331 Iterator<MediaStream> get iterator {
21324 // Note: NodeLists are not fixed size. And most probably length shouldn't 21332 // Note: NodeLists are not fixed size. And most probably length shouldn't
21325 // be cached in both iterator _and_ forEach method. For now caching it 21333 // be cached in both iterator _and_ forEach method. For now caching it
21326 // for consistency. 21334 // for consistency.
21327 return new FixedSizeListIterator<MediaStream>(this); 21335 return new FixedSizeListIterator<MediaStream>(this);
21328 } 21336 }
21329 21337
21330 // From Collection<MediaStream>: 21338 // From Collection<MediaStream>:
21331 21339
21332 void add(MediaStream value) { 21340 void add(MediaStream value) {
21333 throw new UnsupportedError("Cannot add to immutable List."); 21341 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
21573 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index); 21581 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index);
21574 21582
21575 void operator[]=(int index, SpeechInputResult value) { 21583 void operator[]=(int index, SpeechInputResult value) {
21576 throw new UnsupportedError("Cannot assign element of immutable List."); 21584 throw new UnsupportedError("Cannot assign element of immutable List.");
21577 } 21585 }
21578 // -- start List<SpeechInputResult> mixins. 21586 // -- start List<SpeechInputResult> mixins.
21579 // SpeechInputResult is the element type. 21587 // SpeechInputResult is the element type.
21580 21588
21581 // From Iterable<SpeechInputResult>: 21589 // From Iterable<SpeechInputResult>:
21582 21590
21583 Iterator<SpeechInputResult> iterator() { 21591 Iterator<SpeechInputResult> get iterator {
21584 // Note: NodeLists are not fixed size. And most probably length shouldn't 21592 // Note: NodeLists are not fixed size. And most probably length shouldn't
21585 // be cached in both iterator _and_ forEach method. For now caching it 21593 // be cached in both iterator _and_ forEach method. For now caching it
21586 // for consistency. 21594 // for consistency.
21587 return new FixedSizeListIterator<SpeechInputResult>(this); 21595 return new FixedSizeListIterator<SpeechInputResult>(this);
21588 } 21596 }
21589 21597
21590 // From Collection<SpeechInputResult>: 21598 // From Collection<SpeechInputResult>:
21591 21599
21592 void add(SpeechInputResult value) { 21600 void add(SpeechInputResult value) {
21593 throw new UnsupportedError("Cannot add to immutable List."); 21601 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
21679 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index); 21687 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index);
21680 21688
21681 void operator[]=(int index, SpeechRecognitionResult value) { 21689 void operator[]=(int index, SpeechRecognitionResult value) {
21682 throw new UnsupportedError("Cannot assign element of immutable List."); 21690 throw new UnsupportedError("Cannot assign element of immutable List.");
21683 } 21691 }
21684 // -- start List<SpeechRecognitionResult> mixins. 21692 // -- start List<SpeechRecognitionResult> mixins.
21685 // SpeechRecognitionResult is the element type. 21693 // SpeechRecognitionResult is the element type.
21686 21694
21687 // From Iterable<SpeechRecognitionResult>: 21695 // From Iterable<SpeechRecognitionResult>:
21688 21696
21689 Iterator<SpeechRecognitionResult> iterator() { 21697 Iterator<SpeechRecognitionResult> get iterator {
21690 // Note: NodeLists are not fixed size. And most probably length shouldn't 21698 // Note: NodeLists are not fixed size. And most probably length shouldn't
21691 // be cached in both iterator _and_ forEach method. For now caching it 21699 // be cached in both iterator _and_ forEach method. For now caching it
21692 // for consistency. 21700 // for consistency.
21693 return new FixedSizeListIterator<SpeechRecognitionResult>(this); 21701 return new FixedSizeListIterator<SpeechRecognitionResult>(this);
21694 } 21702 }
21695 21703
21696 // From Collection<SpeechRecognitionResult>: 21704 // From Collection<SpeechRecognitionResult>:
21697 21705
21698 void add(SpeechRecognitionResult value) { 21706 void add(SpeechRecognitionResult value) {
21699 throw new UnsupportedError("Cannot add to immutable List."); 21707 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
21776 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index); 21784 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index);
21777 21785
21778 void operator[]=(int index, StyleSheet value) { 21786 void operator[]=(int index, StyleSheet value) {
21779 throw new UnsupportedError("Cannot assign element of immutable List."); 21787 throw new UnsupportedError("Cannot assign element of immutable List.");
21780 } 21788 }
21781 // -- start List<StyleSheet> mixins. 21789 // -- start List<StyleSheet> mixins.
21782 // StyleSheet is the element type. 21790 // StyleSheet is the element type.
21783 21791
21784 // From Iterable<StyleSheet>: 21792 // From Iterable<StyleSheet>:
21785 21793
21786 Iterator<StyleSheet> iterator() { 21794 Iterator<StyleSheet> get iterator {
21787 // Note: NodeLists are not fixed size. And most probably length shouldn't 21795 // Note: NodeLists are not fixed size. And most probably length shouldn't
21788 // be cached in both iterator _and_ forEach method. For now caching it 21796 // be cached in both iterator _and_ forEach method. For now caching it
21789 // for consistency. 21797 // for consistency.
21790 return new FixedSizeListIterator<StyleSheet>(this); 21798 return new FixedSizeListIterator<StyleSheet>(this);
21791 } 21799 }
21792 21800
21793 // From Collection<StyleSheet>: 21801 // From Collection<StyleSheet>:
21794 21802
21795 void add(StyleSheet value) { 21803 void add(StyleSheet value) {
21796 throw new UnsupportedError("Cannot add to immutable List."); 21804 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
21897 Animation operator[](int index) => JS("Animation", "#[#]", this, index); 21905 Animation operator[](int index) => JS("Animation", "#[#]", this, index);
21898 21906
21899 void operator[]=(int index, Animation value) { 21907 void operator[]=(int index, Animation value) {
21900 throw new UnsupportedError("Cannot assign element of immutable List."); 21908 throw new UnsupportedError("Cannot assign element of immutable List.");
21901 } 21909 }
21902 // -- start List<Animation> mixins. 21910 // -- start List<Animation> mixins.
21903 // Animation is the element type. 21911 // Animation is the element type.
21904 21912
21905 // From Iterable<Animation>: 21913 // From Iterable<Animation>:
21906 21914
21907 Iterator<Animation> iterator() { 21915 Iterator<Animation> get iterator {
21908 // Note: NodeLists are not fixed size. And most probably length shouldn't 21916 // Note: NodeLists are not fixed size. And most probably length shouldn't
21909 // be cached in both iterator _and_ forEach method. For now caching it 21917 // be cached in both iterator _and_ forEach method. For now caching it
21910 // for consistency. 21918 // for consistency.
21911 return new FixedSizeListIterator<Animation>(this); 21919 return new FixedSizeListIterator<Animation>(this);
21912 } 21920 }
21913 21921
21914 // From Collection<Animation>: 21922 // From Collection<Animation>:
21915 21923
21916 void add(Animation value) { 21924 void add(Animation value) {
21917 throw new UnsupportedError("Cannot add to immutable List."); 21925 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
23155 static List filter(Iterable<Object> source, 23163 static List filter(Iterable<Object> source,
23156 List<Object> destination, 23164 List<Object> destination,
23157 bool f(o)) { 23165 bool f(o)) {
23158 for (final e in source) { 23166 for (final e in source) {
23159 if (f(e)) destination.add(e); 23167 if (f(e)) destination.add(e);
23160 } 23168 }
23161 return destination; 23169 return destination;
23162 } 23170 }
23163 23171
23164 static bool isEmpty(Iterable<Object> iterable) { 23172 static bool isEmpty(Iterable<Object> iterable) {
23165 return !iterable.iterator().hasNext; 23173 return !iterable.iterator.moveNext();
23166 } 23174 }
23167 } 23175 }
23168 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 23176 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23169 // for details. All rights reserved. Use of this source code is governed by a 23177 // for details. All rights reserved. Use of this source code is governed by a
23170 // BSD-style license that can be found in the LICENSE file. 23178 // BSD-style license that can be found in the LICENSE file.
23171 23179
23172 23180
23173 class _HttpRequestUtils { 23181 class _HttpRequestUtils {
23174 23182
23175 // Helper for factory HttpRequest.get 23183 // Helper for factory HttpRequest.get
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
24845 if (length < 0) throw new ArgumentError('length'); 24853 if (length < 0) throw new ArgumentError('length');
24846 if (start < 0) throw new RangeError.value(start); 24854 if (start < 0) throw new RangeError.value(start);
24847 int end = start + length; 24855 int end = start + length;
24848 if (end > a.length) throw new RangeError.value(end); 24856 if (end > a.length) throw new RangeError.value(end);
24849 for (int i = start; i < end; i++) { 24857 for (int i = start; i < end; i++) {
24850 accumulator.add(a[i]); 24858 accumulator.add(a[i]);
24851 } 24859 }
24852 return accumulator; 24860 return accumulator;
24853 } 24861 }
24854 } 24862 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698