Skip to content
Closed
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
7 changes: 4 additions & 3 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@

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

Choose a reason for hiding this comment

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

Wait, we were assigning this again?? Should I be removing this bit in my PR?

Copy link
Contributor

Choose a reason for hiding this comment

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


// Deprecate GLOBAL and root
Expand Down Expand Up @@ -246,8 +245,10 @@
}

function setupGlobalConsole() {
global.__defineGetter__('console', function() {
return NativeModule.require('console');
Object.defineProperty(global, 'console', {
get() {
return NativeModule.require('console');
}
});
}

Expand Down
6 changes: 6 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4195,6 +4195,12 @@ static void StartNodeInstance(void* arg) {
Isolate::Scope isolate_scope(isolate);
HandleScope handle_scope(isolate);
Local<Context> context = Context::New(isolate);
// note that Global() returns the proxy, which has a prototype
// that is the actual global
Local<Object> global_obj =
context->Global()->GetPrototype().As<Object>();
global_obj->SetPrototype(context, Null(isolate));

Environment* env = CreateEnvironment(isolate, context, instance_data);
array_buffer_allocator->set_env(env);
Context::Scope context_scope(context);
Expand Down
1 change: 0 additions & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ var knownGlobals = [setTimeout,
clearInterval,
clearImmediate,
console,
constructor, // Enumerable in V8 3.21.
Buffer,
process,
global];
Expand Down