Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index f22be5bb5d184125dc0c7c6410d698029113d26b..c5a5ac976386728945d7dfecd29d43f94b92e2d6 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -54,7 +54,12 @@ |
#if !defined(_WIN32) && !defined(_WIN64) |
#include <unistd.h> // NOLINT |
-#endif |
+#else |
+#include <windows.h> // NOLINT |
+#if defined(_MSC_VER) |
+#include <crtdbg.h> // NOLINT |
+#endif // defined(_MSC_VER) |
+#endif // !defined(_WIN32) && !defined(_WIN64) |
#ifndef DCHECK |
#define DCHECK(condition) assert(condition) |
@@ -1595,6 +1600,21 @@ class StartupDataHandler { |
int Shell::Main(int argc, char* argv[]) { |
+#if (defined(_WIN32) || defined(_WIN64)) |
+ UINT new_flags = |
+ SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; |
+ UINT existing_flags = SetErrorMode(new_flags); |
+ SetErrorMode(existing_flags | new_flags); |
+#if defined(_MSC_VER) |
+ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
+ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); |
+ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
+ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); |
+ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); |
+ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
+ _set_error_mode(_OUT_TO_STDERR); |
+#endif // defined(_MSC_VER) |
+#endif // defined(_WIN32) || defined(_WIN64) |
if (!SetOptions(argc, argv)) return 1; |
v8::V8::InitializeICU(options.icu_data_file); |
v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |