diff --git a/common/api/atom_bindings.cc b/common/api/atom_bindings.cc index 6bc85b4d3d5c..4b8e2e6023a8 100644 --- a/common/api/atom_bindings.cc +++ b/common/api/atom_bindings.cc @@ -22,6 +22,7 @@ void AtomBindings::BindTo(v8::Handle process) { v8::HandleScope scope; node::SetMethod(process, "atomBinding", Binding); + node::SetMethod(process, "crash", Crash); } // static @@ -71,4 +72,10 @@ v8::Handle AtomBindings::Binding(const v8::Arguments& args) { v8::String::New("No such module"))); } +// static +v8::Handle AtomBindings::Crash(const v8::Arguments& args) { + __builtin_trap(); + return v8::Undefined(); +} + } // namespace atom diff --git a/common/api/atom_bindings.h b/common/api/atom_bindings.h index 88eb8e08c340..7a1fa330c716 100644 --- a/common/api/atom_bindings.h +++ b/common/api/atom_bindings.h @@ -21,6 +21,7 @@ class AtomBindings { private: static v8::Handle Binding(const v8::Arguments& args); + static v8::Handle Crash(const v8::Arguments& args); DISALLOW_COPY_AND_ASSIGN(AtomBindings); };