| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 patch class NoSuchMethodError { | 5 patch class NoSuchMethodError { |
| 6 /* patch */ static String safeToString(Object object) { | 6 /* patch */ static String _objectToString(Object object) { |
| 7 if (object is int || object is double || object is bool || null == object) { | |
| 8 return object.toString(); | |
| 9 } | |
| 10 if (object is String) { | |
| 11 // TODO(ahe): Remove hack when http://dartbug.com/4995 is fixed. | |
| 12 const hack = '\\' '"'; | |
| 13 String escaped = object.replaceAll('"', hack); | |
| 14 return '"$escaped"'; | |
| 15 } | |
| 16 return Object._toString(object); | 7 return Object._toString(object); |
| 17 } | 8 } |
| 18 } | 9 } |
| OLD | NEW |