diff --git a/browser/api/atom_api_app.cc b/browser/api/atom_api_app.cc index 9116e412142e..f0f2d1882bb1 100644 --- a/browser/api/atom_api_app.cc +++ b/browser/api/atom_api_app.cc @@ -50,6 +50,15 @@ v8::Handle App::Quit(const v8::Arguments &args) { return v8::Undefined(); } +// static +v8::Handle App::Exit(const v8::Arguments &args) { + v8::HandleScope scope; + + exit(args[0]->IntegerValue()); + + return v8::Undefined(); +} + // static v8::Handle App::Terminate(const v8::Arguments &args) { v8::HandleScope scope; @@ -100,6 +109,7 @@ void App::Initialize(v8::Handle target) { t->SetClassName(v8::String::NewSymbol("Application")); NODE_SET_PROTOTYPE_METHOD(t, "quit", Quit); + NODE_SET_PROTOTYPE_METHOD(t, "exit", Exit); NODE_SET_PROTOTYPE_METHOD(t, "terminate", Terminate); target->Set(v8::String::NewSymbol("Application"), t->GetFunction()); diff --git a/browser/api/atom_api_app.h b/browser/api/atom_api_app.h index cb33d0aa56d1..7d1c06c2f97b 100644 --- a/browser/api/atom_api_app.h +++ b/browser/api/atom_api_app.h @@ -31,6 +31,7 @@ class App : public EventEmitter, static v8::Handle New(const v8::Arguments &args); static v8::Handle Quit(const v8::Arguments &args); + static v8::Handle Exit(const v8::Arguments &args); static v8::Handle Terminate(const v8::Arguments &args); static v8::Handle AppendSwitch(const v8::Arguments &args); static v8::Handle AppendArgument(const v8::Arguments &args);