mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-01 12:23:22 +08:00
Crash when there is fatal error in V8.
This commit is contained in:
@@ -53,6 +53,13 @@ void UvOnCallback(uv_async_t* handle, int status) {
|
||||
g_v8_callback->NewHandle()->Call(global, 0, NULL);
|
||||
}
|
||||
|
||||
// Called when there is a fatal error in V8, we just crash the process here so
|
||||
// we can get the stack trace.
|
||||
void FatalErrorCallback(const char* location, const char* message) {
|
||||
LOG(ERROR) << "Fatal error in V8: " << location << " " << message;
|
||||
static_cast<DummyClass*>(NULL)->crash = true;
|
||||
}
|
||||
|
||||
v8::Handle<v8::Object> DumpStackFrame(v8::Handle<v8::StackFrame> stack_frame) {
|
||||
v8::Local<v8::Object> result = v8::Object::New();
|
||||
result->Set(ToV8Value("line"), ToV8Value(stack_frame->GetLineNumber()));
|
||||
@@ -76,6 +83,7 @@ node::node_module_struct* GetBuiltinModule(const char *name, bool is_browser);
|
||||
AtomBindings::AtomBindings() {
|
||||
uv_async_init(uv_default_loop(), &g_next_tick_uv_handle, UvCallNextTick);
|
||||
uv_async_init(uv_default_loop(), &g_callback_uv_handle, UvOnCallback);
|
||||
v8::V8::SetFatalErrorHandler(FatalErrorCallback);
|
||||
}
|
||||
|
||||
AtomBindings::~AtomBindings() {
|
||||
|
||||
2
vendor/node
vendored
2
vendor/node
vendored
Submodule vendor/node updated: 7fa644854f...80c5e17c09
Reference in New Issue
Block a user