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

Unified Diff: client/html/release/htmlimpl.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 9167006: Support map in generated dart:html files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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:
Download patch
Index: client/html/release/htmlimpl.dart
diff --git a/client/html/release/htmlimpl.dart b/client/html/release/htmlimpl.dart
index 406136874ad52409f0194c6584a80fb23919d2aa..9db9a71f53cdb55a6bf922f24362ab2ec119f3cc 100644
--- a/client/html/release/htmlimpl.dart
+++ b/client/html/release/htmlimpl.dart
@@ -1436,6 +1436,10 @@ class CanvasPixelArrayWrappingImplementation extends DOMWrapperBase implements C
_Collections.forEach(this, f);
}
+ Collection map(f(int element)) {
+ return _Collections.map(this, [], f);
+ }
+
Collection<int> filter(bool f(int element)) {
return _Collections.filter(this, new List<int>(), f);
}
@@ -4325,11 +4329,11 @@ class IDBKeyRangeWrappingImplementation extends DOMWrapperBase implements IDBKey
throw "Incorrect number or type of arguments";
}
- IDBKeyRange lowerBound(IDBKey bound_, [bool open]) {
+ IDBKeyRange lowerBound(IDBKey bound, [bool open]) {
if (open === null) {
- return LevelDom.wrapIDBKeyRange(_ptr.lowerBound(LevelDom.unwrap(bound_)));
+ return LevelDom.wrapIDBKeyRange(_ptr.lowerBound(LevelDom.unwrap(bound)));
} else {
- return LevelDom.wrapIDBKeyRange(_ptr.lowerBound(LevelDom.unwrap(bound_), open));
+ return LevelDom.wrapIDBKeyRange(_ptr.lowerBound(LevelDom.unwrap(bound), open));
}
}
@@ -4337,11 +4341,11 @@ class IDBKeyRangeWrappingImplementation extends DOMWrapperBase implements IDBKey
return LevelDom.wrapIDBKeyRange(_ptr.only(LevelDom.unwrap(value)));
}
- IDBKeyRange upperBound(IDBKey bound_, [bool open]) {
+ IDBKeyRange upperBound(IDBKey bound, [bool open]) {
if (open === null) {
- return LevelDom.wrapIDBKeyRange(_ptr.upperBound(LevelDom.unwrap(bound_)));
+ return LevelDom.wrapIDBKeyRange(_ptr.upperBound(LevelDom.unwrap(bound)));
} else {
- return LevelDom.wrapIDBKeyRange(_ptr.upperBound(LevelDom.unwrap(bound_), open));
+ return LevelDom.wrapIDBKeyRange(_ptr.upperBound(LevelDom.unwrap(bound), open));
}
}
}
@@ -5521,6 +5525,10 @@ class MediaListWrappingImplementation extends DOMWrapperBase implements MediaLis
_Collections.forEach(this, f);
}
+ Collection map(f(String element)) {
+ return _Collections.map(this, [], f);
+ }
+
Collection<String> filter(bool f(String element)) {
return _Collections.filter(this, new List<String>(), f);
}
@@ -11116,21 +11124,21 @@ class StorageWrappingImplementation extends DOMWrapperBase implements Storage {
return;
}
- String getItem(String key_) {
- return _ptr.getItem(key_);
+ String getItem(String key) {
+ return _ptr.getItem(key);
}
String key(int index) {
return _ptr.key(index);
}
- void removeItem(String key_) {
- _ptr.removeItem(key_);
+ void removeItem(String key) {
+ _ptr.removeItem(key);
return;
}
- void setItem(String key_, String data) {
- _ptr.setItem(key_, data);
+ void setItem(String key, String data) {
+ _ptr.setItem(key, data);
return;
}
}
@@ -11236,6 +11244,10 @@ class StyleSheetListWrappingImplementation extends DOMWrapperBase implements Sty
_Collections.forEach(this, f);
}
+ Collection map(f(StyleSheet element)) {
+ return _Collections.map(this, [], f);
+ }
+
Collection<StyleSheet> filter(bool f(StyleSheet element)) {
return _Collections.filter(this, new List<StyleSheet>(), f);
}
@@ -11901,6 +11913,10 @@ class TouchListWrappingImplementation extends DOMWrapperBase implements TouchLis
void forEach(void f(Touch element)) {
_Collections.forEach(this, f);
}
+
+ Collection map(f(Touch element)) {
+ return _Collections.map(this, [], f);
+ }
Collection<Touch> filter(bool f(Touch element)) {
return _Collections.filter(this, new List<Touch>(), f);
@@ -18260,6 +18276,15 @@ class _Collections {
}
}
+ static List map(Iterable<Object> source,
+ List<Object> destination,
+ f(o)) {
+ for (final e in source) {
+ destination.add(f(e));
+ }
+ return destination;
+ }
+
static bool some(Iterable<Object> iterable, bool f(Object o)) {
for (final e in iterable) {
if (f(e)) return true;
@@ -21765,11 +21790,11 @@ class FilteredElementList implements ElementList {
}
Element removeLast() {
- var last_ = this.last();
- if (last_ != null) {
- last_.remove();
+ var last = this.last();
+ if (last != null) {
+ last.remove();
}
- return last_;
+ return last;
}
Collection<Element> filter(bool f(Element element)) => _filtered.filter(f);
@@ -22397,11 +22422,11 @@ class _ChildrenElementList implements ElementList {
}
Element removeLast() {
- final last_ = this.last();
- if (last_ != null) {
- _element.removeChild(LevelDom.unwrap(last_));
+ final last = this.last();
+ if (last != null) {
+ _element.removeChild(LevelDom.unwrap(last));
}
- return last_;
+ return last;
}
Element last() {
@@ -23677,11 +23702,11 @@ class _ChildrenNodeList implements NodeList {
}
Node removeLast() {
- final last_ = this.last();
- if (last_ != null) {
- _node.removeChild(LevelDom.unwrap(last_));
+ final last = this.last();
+ if (last != null) {
+ _node.removeChild(LevelDom.unwrap(last));
}
- return last_;
+ return last;
}
Node last() {
« no previous file with comments | « client/html/generated/src/wrapping/_TouchListWrappingImplementation.dart ('k') | client/html/src/_Collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698