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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
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:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index c6821de5210188d05e0e4f6b69a3822546197a16..5de20f6c7f60d0d94b110b4c5ae19bb1dc4bb243 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -7492,6 +7492,13 @@ class DomMimeTypeArray implements JavaScriptIndexingBehavior, List<DomMimeType>
Map<int, DomMimeType> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<DomMimeType> mixins.
@DomName('DOMMimeTypeArray.item')
@@ -7760,6 +7767,13 @@ class DomPluginArray implements JavaScriptIndexingBehavior, List<DomPlugin> nati
Map<int, DomPlugin> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<DomPlugin> mixins.
@DomName('DOMPluginArray.item')
@@ -8135,6 +8149,13 @@ class DomStringList implements JavaScriptIndexingBehavior, List<String> native "
Map<int, String> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<String> mixins.
@DomName('DOMStringList.contains')
@@ -8465,6 +8486,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
@@ -8675,6 +8703,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> {
@@ -9156,6 +9191,12 @@ abstract class Element extends Node implements ElementTraversal native "*Element
throw new UnsupportedError("Not supported on this platform");
}
+ /**
+ * Print out a String representation of this Element. By default, this is
+ * this Element's tagName.
+ */
+ String toString() => this.tagName;
+
@DomName('Element.abortEvent')
@DocsEditable
@@ -11098,6 +11139,13 @@ class FileList implements JavaScriptIndexingBehavior, List<File> native "*FileLi
Map<int, File> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<File> mixins.
@DomName('FileList.item')
@@ -11671,6 +11719,13 @@ class Float32Array extends ArrayBufferView implements JavaScriptIndexingBehavior
Map<int, num> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<num> mixins.
@JSName('set')
@@ -11903,6 +11958,13 @@ class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior
Map<int, num> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<num> mixins.
@JSName('set')
@@ -12555,6 +12617,13 @@ class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native
Map<int, Node> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Node> mixins.
@DomName('HTMLAllCollection.item')
@@ -12776,6 +12845,13 @@ class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "*
Map<int, Node> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Node> mixins.
@DomName('HTMLCollection.item')
@@ -14820,6 +14896,13 @@ class Int16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -15052,6 +15135,13 @@ class Int32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -15284,6 +15374,13 @@ class Int8Array extends ArrayBufferView implements JavaScriptIndexingBehavior, L
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -17797,6 +17894,12 @@ class _ChildNodeListLazy implements List {
List<Node> getRange(int start, int rangeLength) =>
sublist(start, start + rangeLength);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
// -- end List<Node> mixins.
// TODO(jacobr): benchmark whether this is more efficient or whether caching
@@ -18369,6 +18472,13 @@ class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi
Map<int, Node> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Node> mixins.
@JSName('item')
@@ -20693,6 +20803,13 @@ class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior
Map<int, SourceBuffer> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<SourceBuffer> mixins.
@JSName('addEventListener')
@@ -20987,6 +21104,13 @@ class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGramma
Map<int, SpeechGrammar> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<SpeechGrammar> mixins.
@DomName('SpeechGrammarList.addFromString')
@@ -22444,6 +22568,13 @@ class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior
Map<int, TextTrackCue> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<TextTrackCue> mixins.
@DomName('TextTrackCueList.getCueById')
@@ -22663,6 +22794,13 @@ class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L
Map<int, TextTrack> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<TextTrack> mixins.
@JSName('addEventListener')
@@ -23108,6 +23246,13 @@ class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*Touc
Map<int, Touch> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Touch> mixins.
@DomName('TouchList.item')
@@ -23590,6 +23735,13 @@ class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -23822,6 +23974,13 @@ class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -24054,6 +24213,13 @@ class Uint8Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -24283,6 +24449,13 @@ class Uint8ClampedArray extends Uint8Array implements JavaScriptIndexingBehavior
Map<int, int> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<int> mixins.
@JSName('set')
@@ -26883,6 +27056,13 @@ class _ClientRectList implements JavaScriptIndexingBehavior, List<Rect> native "
Map<int, Rect> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Rect> mixins.
@DomName('ClientRectList.item')
@@ -27094,6 +27274,13 @@ class _CssRuleList implements JavaScriptIndexingBehavior, List<CssRule> native "
Map<int, CssRule> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<CssRule> mixins.
@DomName('CSSRuleList.item')
@@ -27305,6 +27492,13 @@ class _CssValueList extends CssValue implements List<CssValue>, JavaScriptIndexi
Map<int, CssValue> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<CssValue> mixins.
@DomName('CSSValueList.item')
@@ -27516,6 +27710,13 @@ class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "*En
Map<int, Entry> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Entry> mixins.
@DomName('EntryArray.item')
@@ -27727,6 +27928,13 @@ class _EntryArraySync implements JavaScriptIndexingBehavior, List<EntrySync> nat
Map<int, EntrySync> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<EntrySync> mixins.
@DomName('EntryArraySync.item')
@@ -27938,6 +28146,13 @@ class _GamepadList implements JavaScriptIndexingBehavior, List<Gamepad> native "
Map<int, Gamepad> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Gamepad> mixins.
@DomName('GamepadList.item')
@@ -28212,6 +28427,13 @@ class _NamedNodeMap implements JavaScriptIndexingBehavior, List<Node> native "*N
Map<int, Node> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<Node> mixins.
@DomName('NamedNodeMap.getNamedItem')
@@ -28447,6 +28669,13 @@ class _SpeechInputResultList implements JavaScriptIndexingBehavior, List<SpeechI
Map<int, SpeechInputResult> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<SpeechInputResult> mixins.
@DomName('SpeechInputResultList.item')
@@ -28658,6 +28887,13 @@ class _SpeechRecognitionResultList implements JavaScriptIndexingBehavior, List<S
Map<int, SpeechRecognitionResult> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<SpeechRecognitionResult> mixins.
@DomName('SpeechRecognitionResultList.item')
@@ -28869,6 +29105,13 @@ class _StyleSheetList implements JavaScriptIndexingBehavior, List<StyleSheet> na
Map<int, StyleSheet> asMap() =>
IterableMixinWorkaround.asMapList(this);
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
+
// -- end List<StyleSheet> mixins.
@DomName('StyleSheetList.item')
@@ -31926,6 +32169,13 @@ class _WrappedList<E> implements List<E> {
}
Map<int, E> asMap() => IterableMixinWorkaround.asMapList(_list);
+
+ String toString() {
+ StringBuffer buffer = new StringBuffer('[');
+ buffer.writeAll(this, ', ');
+ buffer.write(']');
+ return buffer.toString();
+ }
}
/**
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698