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

Unified Diff: dart/runtime/lib/errors_patch.dart

Issue 10943027: Handle backslashes and newlines when escaping strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 3 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 | « dart/lib/core/errors.dart ('k') | dart/tests/corelib/safe_to_string_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/lib/errors_patch.dart
diff --git a/dart/runtime/lib/errors_patch.dart b/dart/runtime/lib/errors_patch.dart
index 5547e584aabe7c33f8d5fa497607f39f9c93315d..fd6ec5800fb0236929996220c34fb799fc352d3c 100644
--- a/dart/runtime/lib/errors_patch.dart
+++ b/dart/runtime/lib/errors_patch.dart
@@ -3,16 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
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) {
- // TODO(ahe): Remove hack when http://dartbug.com/4995 is fixed.
- const hack = '\\' '"';
- String escaped = object.replaceAll('"', hack);
- return '"$escaped"';
- }
+ /* patch */ static String _objectToString(Object object) {
return Object._toString(object);
}
}
« no previous file with comments | « dart/lib/core/errors.dart ('k') | dart/tests/corelib/safe_to_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698