@@ -2280,7 +2280,7 @@ static void LinkedBinding(const FunctionCallbackInfo<Value>& args) {
22802280
22812281static void ProcessTitleGetter (Local<String> property,
22822282 const PropertyCallbackInfo<Value>& info) {
2283- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2283+ Environment* env = Environment::GetCurrent (info);
22842284 HandleScope scope (env->isolate ());
22852285 char buffer[512 ];
22862286 uv_get_process_title (buffer, sizeof (buffer));
@@ -2291,7 +2291,7 @@ static void ProcessTitleGetter(Local<String> property,
22912291static void ProcessTitleSetter (Local<String> property,
22922292 Local<Value> value,
22932293 const PropertyCallbackInfo<void >& info) {
2294- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2294+ Environment* env = Environment::GetCurrent (info);
22952295 HandleScope scope (env->isolate ());
22962296 node::Utf8Value title (env->isolate (), value);
22972297 // TODO(piscisaureus): protect with a lock
@@ -2301,7 +2301,7 @@ static void ProcessTitleSetter(Local<String> property,
23012301
23022302static void EnvGetter (Local<String> property,
23032303 const PropertyCallbackInfo<Value>& info) {
2304- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2304+ Environment* env = Environment::GetCurrent (info);
23052305 HandleScope scope (env->isolate ());
23062306#ifdef __POSIX__
23072307 node::Utf8Value key (env->isolate (), property);
@@ -2325,16 +2325,13 @@ static void EnvGetter(Local<String> property,
23252325 return info.GetReturnValue ().Set (rc);
23262326 }
23272327#endif
2328- // Not found. Fetch from prototype.
2329- info.GetReturnValue ().Set (
2330- info.Data ().As <Object>()->Get (property));
23312328}
23322329
23332330
23342331static void EnvSetter (Local<String> property,
23352332 Local<Value> value,
23362333 const PropertyCallbackInfo<Value>& info) {
2337- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2334+ Environment* env = Environment::GetCurrent (info);
23382335 HandleScope scope (env->isolate ());
23392336#ifdef __POSIX__
23402337 node::Utf8Value key (env->isolate (), property);
@@ -2356,7 +2353,7 @@ static void EnvSetter(Local<String> property,
23562353
23572354static void EnvQuery (Local<String> property,
23582355 const PropertyCallbackInfo<Integer>& info) {
2359- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2356+ Environment* env = Environment::GetCurrent (info);
23602357 HandleScope scope (env->isolate ());
23612358 int32_t rc = -1 ; // Not found unless proven otherwise.
23622359#ifdef __POSIX__
@@ -2384,7 +2381,7 @@ static void EnvQuery(Local<String> property,
23842381
23852382static void EnvDeleter (Local<String> property,
23862383 const PropertyCallbackInfo<Boolean>& info) {
2387- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2384+ Environment* env = Environment::GetCurrent (info);
23882385 HandleScope scope (env->isolate ());
23892386 bool rc = true ;
23902387#ifdef __POSIX__
@@ -2407,7 +2404,7 @@ static void EnvDeleter(Local<String> property,
24072404
24082405
24092406static void EnvEnumerator (const PropertyCallbackInfo<Array>& info) {
2410- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2407+ Environment* env = Environment::GetCurrent (info);
24112408 HandleScope scope (env->isolate ());
24122409#ifdef __POSIX__
24132410 int size = 0 ;
@@ -2508,7 +2505,7 @@ static Handle<Object> GetFeatures(Environment* env) {
25082505
25092506static void DebugPortGetter (Local<String> property,
25102507 const PropertyCallbackInfo<Value>& info) {
2511- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2508+ Environment* env = Environment::GetCurrent (info);
25122509 HandleScope scope (env->isolate ());
25132510 info.GetReturnValue ().Set (debug_port);
25142511}
@@ -2517,7 +2514,7 @@ static void DebugPortGetter(Local<String> property,
25172514static void DebugPortSetter (Local<String> property,
25182515 Local<Value> value,
25192516 const PropertyCallbackInfo<void >& info) {
2520- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2517+ Environment* env = Environment::GetCurrent (info);
25212518 HandleScope scope (env->isolate ());
25222519 debug_port = value->Int32Value ();
25232520}
@@ -2530,7 +2527,7 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args);
25302527
25312528void NeedImmediateCallbackGetter (Local<String> property,
25322529 const PropertyCallbackInfo<Value>& info) {
2533- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2530+ Environment* env = Environment::GetCurrent (info);
25342531 const uv_check_t * immediate_check_handle = env->immediate_check_handle ();
25352532 bool active = uv_is_active (
25362533 reinterpret_cast <const uv_handle_t *>(immediate_check_handle));
@@ -2543,7 +2540,7 @@ static void NeedImmediateCallbackSetter(
25432540 Local<Value> value,
25442541 const PropertyCallbackInfo<void >& info) {
25452542 HandleScope handle_scope (info.GetIsolate ());
2546- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2543+ Environment* env = Environment::GetCurrent (info);
25472544
25482545 uv_check_t * immediate_check_handle = env->immediate_check_handle ();
25492546 bool active = uv_is_active (
@@ -2626,7 +2623,8 @@ void SetupProcessObject(Environment* env,
26262623
26272624 process->SetAccessor (env->title_string (),
26282625 ProcessTitleGetter,
2629- ProcessTitleSetter);
2626+ ProcessTitleSetter,
2627+ env->as_external ());
26302628
26312629 // process.version
26322630 READONLY_PROPERTY (process,
@@ -2741,15 +2739,16 @@ void SetupProcessObject(Environment* env,
27412739 EnvQuery,
27422740 EnvDeleter,
27432741 EnvEnumerator,
2744- Object::New ( env->isolate () ));
2742+ env->as_external ( ));
27452743 Local<Object> process_env = process_env_template->NewInstance ();
27462744 process->Set (env->env_string (), process_env);
27472745
27482746 READONLY_PROPERTY (process, " pid" , Integer::New (env->isolate (), getpid ()));
27492747 READONLY_PROPERTY (process, " features" , GetFeatures (env));
27502748 process->SetAccessor (env->need_imm_cb_string (),
2751- NeedImmediateCallbackGetter,
2752- NeedImmediateCallbackSetter);
2749+ NeedImmediateCallbackGetter,
2750+ NeedImmediateCallbackSetter,
2751+ env->as_external ());
27532752
27542753 // -e, --eval
27552754 if (eval_string) {
@@ -2812,7 +2811,8 @@ void SetupProcessObject(Environment* env,
28122811
28132812 process->SetAccessor (env->debug_port_string (),
28142813 DebugPortGetter,
2815- DebugPortSetter);
2814+ DebugPortSetter,
2815+ env->as_external ());
28162816
28172817 // define various internal methods
28182818 env->SetMethod (process,
0 commit comments