From f8ce848d9b9d40d4ac16e1d15de86b1b59cf33d3 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 17 Sep 2010 00:01:07 -0700 Subject: [PATCH] Remove process.global --- src/node.cc | 7 ++----- src/node.js | 5 +++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/node.cc b/src/node.cc index 52fad0dece..5ba908fd92 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1545,11 +1545,6 @@ static void Load(int argc, char *argv[]) { ProcessTitleGetter, ProcessTitleSetter); - - // Add a reference to the global object - Local global = v8::Context::GetCurrent()->Global(); - process->Set(String::NewSymbol("global"), global); - // process.version process->Set(String::NewSymbol("version"), String::New(NODE_VERSION)); @@ -1672,6 +1667,8 @@ static void Load(int argc, char *argv[]) { // who do not like how 'src/node.js' setups the module system but do like // Node's I/O bindings may want to replace 'f' with their own function. + // Add a reference to the global object + Local global = v8::Context::GetCurrent()->Global(); Local args[1] = { Local::New(process) }; f->Call(global, 1, args); diff --git a/src/node.js b/src/node.js index 6001ceefa2..d504e10bec 100644 --- a/src/node.js +++ b/src/node.js @@ -1,7 +1,8 @@ (function (process) { -process.global.process = process; -process.global.global = process.global; +global = this; +global.process = process; +global.global = global; global.GLOBAL = global; global.root = global;