diff --git a/doc/api/process.markdown b/doc/api/process.markdown index 365e97573..d30960b8f 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -145,6 +145,11 @@ Example: /usr/local/bin/node +### process.abort() + +This causes node to emit an abort. This will cause node to exit and +generate a core file. + ### process.chdir(directory) Changes the current working directory of the process or throws an exception if that fails. diff --git a/src/node.cc b/src/node.cc index 11b6fa770..5d00d518c 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1199,6 +1199,11 @@ Local ExecuteString(Handle source, Handle filename) { } +static Handle Abort(const Arguments& args) { + abort(); +} + + static Handle Chdir(const Arguments& args) { HandleScope scope; @@ -2059,6 +2064,7 @@ Handle SetupProcessObject(int argc, char *argv[]) { // define various internal methods NODE_SET_METHOD(process, "_needTickCallback", NeedTickCallback); NODE_SET_METHOD(process, "reallyExit", Exit); + NODE_SET_METHOD(process, "abort", Abort); NODE_SET_METHOD(process, "chdir", Chdir); NODE_SET_METHOD(process, "cwd", Cwd);