From e6dbf8d632b9fd6797db00e59b02d2179f221fb5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 4 Mar 2010 13:00:37 -0800 Subject: [PATCH] Revert "Remove process.unloop()" People need this for backwards compatibility. Will be removed soon though! This reverts commit 1e710cafa704cf451782e8c96e1b57418561600e. --- src/node.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/node.cc b/src/node.cc index e6904a1e2fd..205c8aeab52 100644 --- a/src/node.cc +++ b/src/node.cc @@ -424,6 +424,19 @@ static Handle Loop(const Arguments& args) { return Undefined(); } +static Handle Unloop(const Arguments& args) { + HandleScope scope; + int how = EVUNLOOP_ONE; + if (args[0]->IsString()) { + String::Utf8Value how_s(args[0]->ToString()); + if (0 == strcmp(*how_s, "all")) { + how = EVUNLOOP_ALL; + } + } + ev_unloop(EV_DEFAULT_ how); + return Undefined(); +} + static Handle Chdir(const Arguments& args) { HandleScope scope; @@ -1036,6 +1049,7 @@ static void Load(int argc, char *argv[]) { // define various internal methods NODE_SET_METHOD(process, "loop", Loop); + NODE_SET_METHOD(process, "unloop", Unloop); NODE_SET_METHOD(process, "compile", Compile); NODE_SET_METHOD(process, "_byteLength", ByteLength); NODE_SET_METHOD(process, "reallyExit", Exit);