Cause a real crash instead of debugger break in process.crash().

On Windows the debugger break would not be treated as crash.
This commit is contained in:
Cheng Zhao 2013-11-19 21:36:18 +08:00
parent 1af4ecfc26
commit 2228184066

View file

@ -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<v8::Value> AtomBindings::Binding(const v8::Arguments& args) {
// static
v8::Handle<v8::Value> AtomBindings::Crash(const v8::Arguments& args) {
base::debug::BreakDebugger();
static_cast<DummyClass*>(NULL)->crash = true;
return v8::Undefined();
}