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

Unified Diff: runtime/lib/string_buffer_patch.dart

Issue 1263963003: Fix some TODOs (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/lib/math_patch.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « runtime/lib/math_patch.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698