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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 13704017: Make html lists print a nice toString method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/src/WrappedList.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 6d34148c72457c2b0e0d4ecf50f8053071d8dbe3..4993f03c6f472e7cd0c181ea58f37a5e8e00fe80 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -282,6 +282,13 @@ class _ChildrenElementList implements List {
Map<int, Element> asMap() {
return IterableMixinWorkaround.asMapList(this);
}
+
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
}
// TODO(jacobr): this is an inefficient implementation but it is hard to see
@@ -492,6 +499,13 @@ class _FrozenElementList implements List {
Map<int, Element> asMap() {
return IterableMixinWorkaround.asMapList(this);
}
+
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
}
class _FrozenElementListIterator implements Iterator<Element> {
@@ -979,6 +993,12 @@ $if DART2JS
$else
$endif
+ /**
+ * Print out a String representation of this Element. By default, this is
+ * this Element's tagName.
+ */
+ String toString() => this.tagName;
+
$!MEMBERS
}
« no previous file with comments | « tools/dom/src/WrappedList.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698