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

Unified Diff: runtime/lib/errors_patch.dart

Issue 718053003: Reduce foot-print of Error.safeToString on strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « no previous file | sdk/lib/_internal/compiler/js_lib/core_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/errors_patch.dart
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index b65ae30fe9781545411ce8fae31d272e62f8a40d..5f9bd9f0cb58ab59d1a0683fbb4a0515a4b12216 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -3,12 +3,17 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:mirrors' show MirrorSystem;
+import 'dart:convert' show JSON;
patch class Error {
/* patch */ static String _objectToString(Object object) {
return Object._toString(object);
}
+ /* patch */ static String _stringToSafeString(String string) {
+ return JSON.encode(string);
+ }
+
/* patch */ StackTrace get stackTrace => _stackTrace;
StackTrace _stackTrace;
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698