File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 8
8
'use strict' ;
9
9
10
10
( function ( process ) {
11
- this . global = this ;
12
11
13
12
function startup ( ) {
14
13
var EventEmitter = NativeModule . require ( 'events' ) ;
200
199
201
200
function setupGlobalVariables ( ) {
202
201
global . process = process ;
203
- global . global = global ;
204
202
global . GLOBAL = global ;
205
203
global . root = global ;
206
204
global . Buffer = NativeModule . require ( 'buffer' ) . Buffer ;
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ using v8::Local;
117
117
using v8::Locker;
118
118
using v8::MaybeLocal;
119
119
using v8::Message;
120
+ using v8::Null;
120
121
using v8::Number;
121
122
using v8::Object;
122
123
using v8::ObjectTemplate;
@@ -3257,8 +3258,12 @@ void LoadEnvironment(Environment* env) {
3257
3258
3258
3259
env->SetMethod (env->process_object (), " _rawDebug" , RawDebug);
3259
3260
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
+
3260
3265
Local<Value> arg = env->process_object ();
3261
- f->Call (global , 1 , &arg);
3266
+ f->Call (Null (env-> isolate ()) , 1 , &arg);
3262
3267
}
3263
3268
3264
3269
static void PrintHelp ();
You can’t perform that action at this time.
0 commit comments