Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: remove bootstrap global context indirection #5881

Merged
merged 1 commit into from
Mar 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -211,7 +210,6 @@

function setupGlobalVariables() {
global.process = process;
global.global = global;
const util = NativeModule.require('util');

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #5888 (comment)

Looks this is was duplicated and unnecessary.

// Deprecate GLOBAL and root
Expand Down
7 changes: 6 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ using v8::Locker;
using v8::MaybeLocal;
using v8::Message;
using v8::Name;
using v8::Null;
using v8::Number;
using v8::Object;
using v8::ObjectTemplate;
Expand Down Expand Up @@ -3321,8 +3322,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()), ARRAY_SIZE(&arg), &arg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code was changed after I reviewed it? Because ARRAY_SIZE(&arg) doesn't do what you think it does.

}

static void PrintHelp();
Expand Down