- Electron version: v1.3.4 and HEAD.

Node's [`process.exit`](https://nodejs.org/api/process.html#process_process_exit_code) takes an **optional** code argument, which defaults to `0`.

Electron's [`app.exit`](http://electron.atom.io/docs/api/app/#appexitexitcode) takes a **required** code argument.

So the current [`process.exit = app.exit`](https://github.com/electron/electron/blob/b5dec9990eb34a711c57a4f639b2c4c8de866d5f/lib/browser/init.js#L101) breaks electron's `process`-api compatibility with node.

Which causes unhappiness.  For example, when asking `argparse` to print help and exit.  This `(new require('argparse').ArgumentParser()).parseArgs(['--help'])` complains `.: error: Error processing argument at index 0, conversion failure from undefined`.

 `process.exit = app.exit` could be changed to something like `process.exit = function AppExitWithOptionalCode (exitCode) { return app.exit(exitCode || 0); }`.  In node v5.4.1 at least, `process.exit(undefined)` behaves the same as `process.exit()`.  Or perhaps a more precise `app.exit.apply(app, arguments.length ? arguments : [0])`.

atom/browser/browser.cc
FOR_EACH_OBSERVER(BrowserObserver,
                    observers_,
                    OnAccessibilitySupportChanged());
}
void Browser::RequestLogin(
    LoginHandler* login_handler,
    std::unique_ptr<base::DictionaryValue> request_details) {
  FOR_EACH_OBSERVER(BrowserObserver,
                    observers_,
                    OnLogin(login_handler, *(request_details.get())));
}
void Browser::NotifyAndShutdown() {
  if (is_shutdown_)
    return;
  bool prevent_default = false;
  FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillQuit(&prevent_default));
  if (prevent_default) {
    is_quiting_ = false;
    return;
  }
  Shutdown();
}
bool Browser::HandleBeforeQuit() {