Index: src/ostreams.cc |
diff --git a/src/ostreams.cc b/src/ostreams.cc |
index 8a25c4592ae5d1798daeeb1eadf47ad2d76d9172..b04803cf9f6e77fc0589ee235f0cd57aa277bc96 100644 |
--- a/src/ostreams.cc |
+++ b/src/ostreams.cc |
@@ -158,4 +158,13 @@ OFStream& OFStream::flush() { |
return *this; |
} |
+ |
+OStream& operator<<(OStream& os, const AsUC16& c) { |
+ char buf[10]; |
+ const char* format = (0x20 <= c.value && c.value <= 0x7F) |
+ ? "%c" |
+ : (c.value <= 0xff) ? "\\x%02x" : "\\u%04x"; |
+ snprintf(buf, sizeof(buf), format, c.value); |
+ return os << buf; |
+} |
} } // namespace v8::internal |