Index: runtime/lib/string_buffer_patch.dart |
diff --git a/runtime/lib/string_buffer_patch.dart b/runtime/lib/string_buffer_patch.dart |
index 6991ead060e0225bb5734b9166d7683c6f3d5f65..d08755082a1c82aac149d3111da98f843a9816c9 100644 |
--- a/runtime/lib/string_buffer_patch.dart |
+++ b/runtime/lib/string_buffer_patch.dart |
@@ -55,17 +55,7 @@ patch class StringBuffer { |
/* patch */ int get length => _partsCodeUnits + _bufferPosition; |
/* patch */ void write(Object obj) { |
- String str; |
- if (obj is String) { |
- str = obj; |
- } else { |
- // TODO(srdjan): The following four lines could be replaced by |
- // '$obj', but apparently this is too slow on the Dart VM. |
- str = obj.toString(); |
- if (str is! String) { |
- throw new ArgumentError('toString() did not return a string'); |
- } |
- } |
+ String str = '$obj'; |
if (str.isEmpty) return; |
_consumeBuffer(); |
_addPart(str); |