| Index: dart/lib/compiler/implementation/lib/core_patch.dart
|
| diff --git a/dart/lib/compiler/implementation/lib/core_patch.dart b/dart/lib/compiler/implementation/lib/core_patch.dart
|
| index bc881b3391220ec29540977276584feb97808576..70ac1c3ac87b32c5c11be9f9646cf0372033a8c4 100644
|
| --- a/dart/lib/compiler/implementation/lib/core_patch.dart
|
| +++ b/dart/lib/compiler/implementation/lib/core_patch.dart
|
| @@ -65,3 +65,16 @@ patch class int {
|
| patch class double {
|
| patch static double parse(String string) => Primitives.parseDouble(string);
|
| }
|
| +
|
| +patch class NoSuchMethodError {
|
| + patch static String safeToString(Object object) {
|
| + if (object is int || object is double || object is bool || null == object) {
|
| + return object.toString();
|
| + }
|
| + if (object is String) {
|
| + String escaped = object.replaceAll('"', '\\"');
|
| + return '"$escaped"';
|
| + }
|
| + return Primitives.objectToString(object);
|
| + }
|
| +}
|
|
|