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

Unified Diff: src/ostreams.cc

Issue 882973002: [turbofan] Improve JSON output (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ASAN Created 5 years, 11 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
Index: src/ostreams.cc
diff --git a/src/ostreams.cc b/src/ostreams.cc
index 1385e7cf315a71c964e22e1d5fdad34e72f8b400..4f28141d71aa4667bafd7f4742d97d26b5587636 100644
--- a/src/ostreams.cc
+++ b/src/ostreams.cc
@@ -66,6 +66,15 @@ std::ostream& operator<<(std::ostream& os, const AsReversiblyEscapedUC16& c) {
}
+std::ostream& operator<<(std::ostream& os, const AsEscapedUC16ForJSON& c) {
+ if (c.value == '\n') return os << "\\n";
+ if (c.value == '\r') return os << "\\r";
+ if (c.value == '\"') return os << "\\\"";
+ if (c.value == '\'') return os << "\\\'";
+ return PrintUC16(os, c.value, IsOK);
+}
+
+
std::ostream& operator<<(std::ostream& os, const AsUC16& c) {
return PrintUC16(os, c.value, IsPrint);
}

Powered by Google App Engine
This is Rietveld 408576698