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' ) ;
211
210
212
211
function setupGlobalVariables ( ) {
213
212
global . process = process ;
214
- global . global = global ;
215
213
const util = NativeModule . require ( 'util' ) ;
216
214
217
215
// Deprecate GLOBAL and root
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ using v8::Locker;
118
118
using v8::MaybeLocal;
119
119
using v8::Message;
120
120
using v8::Name;
121
+ using v8::Null;
121
122
using v8::Number;
122
123
using v8::Object;
123
124
using v8::ObjectTemplate;
@@ -3321,8 +3322,12 @@ void LoadEnvironment(Environment* env) {
3321
3322
3322
3323
env->SetMethod (env->process_object (), " _rawDebug" , RawDebug);
3323
3324
3325
+ // Expose the global object as a property on itself
3326
+ // (Allows you to set stuff on `global` from anywhere in JavaScript.)
3327
+ global->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " global" ), global);
3328
+
3324
3329
Local<Value> arg = env->process_object ();
3325
- f->Call (global, 1 , &arg);
3330
+ f->Call (Null (env-> isolate ()), ARRAY_SIZE (&arg) , &arg);
3326
3331
}
3327
3332
3328
3333
static void PrintHelp ();
You can’t perform that action at this time.
0 commit comments