Add process.abort

This commit is contained in:
Robert Mustacchi 2011-12-14 17:02:15 -08:00 committed by Ryan Dahl
parent b3a7de15b7
commit 2240486d3d
2 changed files with 11 additions and 0 deletions

View File

@ -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.

View File

@ -1199,6 +1199,11 @@ Local<Value> ExecuteString(Handle<String> source, Handle<Value> filename) {
}
static Handle<Value> Abort(const Arguments& args) {
abort();
}
static Handle<Value> Chdir(const Arguments& args) {
HandleScope scope;
@ -2059,6 +2064,7 @@ Handle<Object> 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);