Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/src/ostreams.cc b/src/ostreams.cc
index ee0474d..a7a67f5 100644
--- a/src/ostreams.cc
+++ b/src/ostreams.cc
@@ -5,8 +5,10 @@
#include "src/ostreams.h"
#if V8_OS_WIN
+#if _MSC_VER < 1900
#define snprintf sprintf_s
#endif
+#endif
namespace v8 {
namespace internal {
@@ -17,7 +19,7 @@
OFStreamBase::~OFStreamBase() {}
-OFStreamBase::int_type OFStreamBase::sync() {
+int OFStreamBase::sync() {
std::fflush(f_);
return 0;
}
@@ -28,8 +30,15 @@
}
-OFStream::OFStream(FILE* f) : OFStreamBase(f), std::ostream(this) {
+std::streamsize OFStreamBase::xsputn(const char* s, std::streamsize n) {
+ return static_cast<std::streamsize>(
+ std::fwrite(s, 1, static_cast<size_t>(n), f_));
+}
+
+
+OFStream::OFStream(FILE* f) : std::ostream(nullptr), buf_(f) {
DCHECK_NOT_NULL(f);
+ rdbuf(&buf_);
}
@@ -59,6 +68,15 @@
}
+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 == '\t') return os << "\\t";
+ 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);
}