Skip to content

Commit

Permalink
lib: remove bootstrap global context indirection
Browse files Browse the repository at this point in the history
PR-URL: nodejs#5881
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>

Conflicts:
	lib/internal/bootstrap_node.js
	src/node.cc
  • Loading branch information
Fishrock123 committed Apr 7, 2016
1 parent e966d1f commit daa191f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
'use strict';

(function(process) {
this.global = this;

function startup() {
var EventEmitter = NativeModule.require('events');
Expand Down Expand Up @@ -200,7 +199,6 @@

function setupGlobalVariables() {
global.process = process;
global.global = global;
global.GLOBAL = global;
global.root = global;
global.Buffer = NativeModule.require('buffer').Buffer;
Expand Down
7 changes: 6 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ using v8::Local;
using v8::Locker;
using v8::MaybeLocal;
using v8::Message;
using v8::Null;
using v8::Number;
using v8::Object;
using v8::ObjectTemplate;
Expand Down Expand Up @@ -3257,8 +3258,12 @@ void LoadEnvironment(Environment* env) {

env->SetMethod(env->process_object(), "_rawDebug", RawDebug);

// Expose the global object as a property on itself
// (Allows you to set stuff on `global` from anywhere in JavaScript.)
global->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "global"), global);

Local<Value> arg = env->process_object();
f->Call(global, 1, &arg);
f->Call(Null(env->isolate()), 1, &arg);
}

static void PrintHelp();
Expand Down

0 comments on commit daa191f

Please sign in to comment.