From 2228184066d5b5fae6d9ef3382adc7e5c8f5f9e2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 19 Nov 2013 21:36:18 +0800 Subject: [PATCH] Cause a real crash instead of debugger break in process.crash(). On Windows the debugger break would not be treated as crash. --- common/api/atom_bindings.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/api/atom_bindings.cc b/common/api/atom_bindings.cc index 3216232..d86698d 100644 --- a/common/api/atom_bindings.cc +++ b/common/api/atom_bindings.cc @@ -4,7 +4,6 @@ #include "common/api/atom_bindings.h" -#include "base/debug/debugger.h" #include "base/logging.h" #include "common/atom_version.h" #include "common/v8_conversions.h" @@ -18,6 +17,8 @@ static int kMaxCallStackSize = 200; // Same with WebKit. static uv_async_t dummy_uv_handle; +struct DummyClass { bool crash; }; + void UvNoOp(uv_async_t* handle, int status) { } @@ -110,7 +111,7 @@ v8::Handle AtomBindings::Binding(const v8::Arguments& args) { // static v8::Handle AtomBindings::Crash(const v8::Arguments& args) { - base::debug::BreakDebugger(); + static_cast(NULL)->crash = true; return v8::Undefined(); } -- 2.7.4