| Index: dart/sdk/lib/core/string_buffer.dart
|
| diff --git a/dart/sdk/lib/core/string_buffer.dart b/dart/sdk/lib/core/string_buffer.dart
|
| index 3c517ea86be339d847b6ed71b7ec5ad17a60c50f..fda711180b87694cca9e8c48621ecef622115e4f 100644
|
| --- a/dart/sdk/lib/core/string_buffer.dart
|
| +++ b/dart/sdk/lib/core/string_buffer.dart
|
| @@ -54,8 +54,13 @@ class _StringBufferImpl implements StringBuffer {
|
|
|
| /// Adds [obj] to the buffer.
|
| void add(Object obj) {
|
| + // TODO(srdjan): The following four lines could be replaced by
|
| + // '$obj', but apparently this is too slow on the Dart VM.
|
| String str = obj.toString();
|
| - if (str == null || str.isEmpty) return;
|
| + if (str is !String) {
|
| + throw new ArgumentError('toString() did not return a string');
|
| + }
|
| + if (str.isEmpty) return;
|
| _buffer.add(str);
|
| _length += str.length;
|
| }
|
|
|