| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 patch class NoSuchMethodError { |
| 6 /* patch */ static String safeToString(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 String escaped = object.replaceAll('"', '\\"'); |
| 12 return '"$escaped"'; |
| 13 } |
| 14 return Object._toString(object); |
| 15 } |
| 16 } |
| OLD | NEW |