mirror of https://github.com/lukechilds/node.git
Browse Source
the process object might return in the future but for now it is going away.v0.7.4-release
Ryan
16 years ago
7 changed files with 15 additions and 67 deletions
@ -1,39 +0,0 @@ |
|||
#include "process.h" |
|||
#include "node.h" |
|||
#include <v8.h> |
|||
#include <stdlib.h> |
|||
|
|||
using namespace v8; |
|||
|
|||
static Handle<Value> |
|||
ExitCallback (const Arguments& args) |
|||
{ |
|||
int exit_code = 0; |
|||
if (args.Length() > 0) exit_code = args[0]->IntegerValue(); |
|||
exit(exit_code); |
|||
return Undefined(); |
|||
} |
|||
|
|||
static Handle<Value> |
|||
OnCallback (const Arguments& args) |
|||
{ |
|||
return Undefined(); |
|||
} |
|||
|
|||
void |
|||
node::Init_process (Handle<Object> target) |
|||
{ |
|||
HandleScope scope; |
|||
|
|||
Local<Object> process = ObjectTemplate::New()->NewInstance(); |
|||
|
|||
target->Set(String::NewSymbol("process"), process); |
|||
|
|||
// process.exit()
|
|||
Local<FunctionTemplate> process_exit = FunctionTemplate::New(ExitCallback); |
|||
process->Set(String::NewSymbol("exit"), process_exit->GetFunction()); |
|||
|
|||
// process.on()
|
|||
Local<FunctionTemplate> process_on = FunctionTemplate::New(OnCallback); |
|||
process->Set(String::NewSymbol("on"), process_exit->GetFunction()); |
|||
} |
@ -1,11 +0,0 @@ |
|||
#ifndef node_process_h |
|||
#define node_process_h |
|||
|
|||
#include <v8.h> |
|||
|
|||
namespace node { |
|||
|
|||
void Init_process (v8::Handle<v8::Object> target); |
|||
|
|||
} // namespace node
|
|||
#endif |
Loading…
Reference in new issue