File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 88'use strict' ;
99
1010( function ( process ) {
11- this . global = this ;
1211
1312 function startup ( ) {
1413 var EventEmitter = NativeModule . require ( 'events' ) ;
200199
201200 function setupGlobalVariables ( ) {
202201 global . process = process ;
203- global . global = global ;
204202 global . GLOBAL = global ;
205203 global . root = global ;
206204 global . Buffer = NativeModule . require ( 'buffer' ) . Buffer ;
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ using v8::Local;
117117using v8::Locker;
118118using v8::MaybeLocal;
119119using v8::Message;
120+ using v8::Null;
120121using v8::Number;
121122using v8::Object;
122123using v8::ObjectTemplate;
@@ -3257,8 +3258,12 @@ void LoadEnvironment(Environment* env) {
32573258
32583259 env->SetMethod (env->process_object (), " _rawDebug" , RawDebug);
32593260
3261+ // Expose the global object as a property on itself
3262+ // (Allows you to set stuff on `global` from anywhere in JavaScript.)
3263+ global->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " global" ), global);
3264+
32603265 Local<Value> arg = env->process_object ();
3261- f->Call (global , 1 , &arg);
3266+ f->Call (Null (env-> isolate ()) , 1 , &arg);
32623267}
32633268
32643269static void PrintHelp ();
You can’t perform that action at this time.
0 commit comments