@@ -2280,7 +2280,7 @@ static void LinkedBinding(const FunctionCallbackInfo<Value>& args) {
2280
2280
2281
2281
static void ProcessTitleGetter (Local<String> property,
2282
2282
const PropertyCallbackInfo<Value>& info) {
2283
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2283
+ Environment* env = Environment::GetCurrent (info);
2284
2284
HandleScope scope (env->isolate ());
2285
2285
char buffer[512 ];
2286
2286
uv_get_process_title (buffer, sizeof (buffer));
@@ -2291,7 +2291,7 @@ static void ProcessTitleGetter(Local<String> property,
2291
2291
static void ProcessTitleSetter (Local<String> property,
2292
2292
Local<Value> value,
2293
2293
const PropertyCallbackInfo<void >& info) {
2294
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2294
+ Environment* env = Environment::GetCurrent (info);
2295
2295
HandleScope scope (env->isolate ());
2296
2296
node::Utf8Value title (env->isolate (), value);
2297
2297
// TODO(piscisaureus): protect with a lock
@@ -2301,7 +2301,7 @@ static void ProcessTitleSetter(Local<String> property,
2301
2301
2302
2302
static void EnvGetter (Local<String> property,
2303
2303
const PropertyCallbackInfo<Value>& info) {
2304
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2304
+ Environment* env = Environment::GetCurrent (info);
2305
2305
HandleScope scope (env->isolate ());
2306
2306
#ifdef __POSIX__
2307
2307
node::Utf8Value key (env->isolate (), property);
@@ -2325,16 +2325,13 @@ static void EnvGetter(Local<String> property,
2325
2325
return info.GetReturnValue ().Set (rc);
2326
2326
}
2327
2327
#endif
2328
- // Not found. Fetch from prototype.
2329
- info.GetReturnValue ().Set (
2330
- info.Data ().As <Object>()->Get (property));
2331
2328
}
2332
2329
2333
2330
2334
2331
static void EnvSetter (Local<String> property,
2335
2332
Local<Value> value,
2336
2333
const PropertyCallbackInfo<Value>& info) {
2337
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2334
+ Environment* env = Environment::GetCurrent (info);
2338
2335
HandleScope scope (env->isolate ());
2339
2336
#ifdef __POSIX__
2340
2337
node::Utf8Value key (env->isolate (), property);
@@ -2356,7 +2353,7 @@ static void EnvSetter(Local<String> property,
2356
2353
2357
2354
static void EnvQuery (Local<String> property,
2358
2355
const PropertyCallbackInfo<Integer>& info) {
2359
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2356
+ Environment* env = Environment::GetCurrent (info);
2360
2357
HandleScope scope (env->isolate ());
2361
2358
int32_t rc = -1 ; // Not found unless proven otherwise.
2362
2359
#ifdef __POSIX__
@@ -2384,7 +2381,7 @@ static void EnvQuery(Local<String> property,
2384
2381
2385
2382
static void EnvDeleter (Local<String> property,
2386
2383
const PropertyCallbackInfo<Boolean >& info) {
2387
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2384
+ Environment* env = Environment::GetCurrent (info);
2388
2385
HandleScope scope (env->isolate ());
2389
2386
bool rc = true ;
2390
2387
#ifdef __POSIX__
@@ -2407,7 +2404,7 @@ static void EnvDeleter(Local<String> property,
2407
2404
2408
2405
2409
2406
static void EnvEnumerator (const PropertyCallbackInfo<Array>& info) {
2410
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2407
+ Environment* env = Environment::GetCurrent (info);
2411
2408
HandleScope scope (env->isolate ());
2412
2409
#ifdef __POSIX__
2413
2410
int size = 0 ;
@@ -2508,7 +2505,7 @@ static Handle<Object> GetFeatures(Environment* env) {
2508
2505
2509
2506
static void DebugPortGetter (Local<String> property,
2510
2507
const PropertyCallbackInfo<Value>& info) {
2511
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2508
+ Environment* env = Environment::GetCurrent (info);
2512
2509
HandleScope scope (env->isolate ());
2513
2510
info.GetReturnValue ().Set (debug_port);
2514
2511
}
@@ -2517,7 +2514,7 @@ static void DebugPortGetter(Local<String> property,
2517
2514
static void DebugPortSetter (Local<String> property,
2518
2515
Local<Value> value,
2519
2516
const PropertyCallbackInfo<void >& info) {
2520
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2517
+ Environment* env = Environment::GetCurrent (info);
2521
2518
HandleScope scope (env->isolate ());
2522
2519
debug_port = value->Int32Value ();
2523
2520
}
@@ -2530,7 +2527,7 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args);
2530
2527
2531
2528
void NeedImmediateCallbackGetter (Local<String> property,
2532
2529
const PropertyCallbackInfo<Value>& info) {
2533
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2530
+ Environment* env = Environment::GetCurrent (info);
2534
2531
const uv_check_t * immediate_check_handle = env->immediate_check_handle ();
2535
2532
bool active = uv_is_active (
2536
2533
reinterpret_cast <const uv_handle_t *>(immediate_check_handle));
@@ -2543,7 +2540,7 @@ static void NeedImmediateCallbackSetter(
2543
2540
Local<Value> value,
2544
2541
const PropertyCallbackInfo<void >& info) {
2545
2542
HandleScope handle_scope (info.GetIsolate ());
2546
- Environment* env = Environment::GetCurrent (info. GetIsolate () );
2543
+ Environment* env = Environment::GetCurrent (info);
2547
2544
2548
2545
uv_check_t * immediate_check_handle = env->immediate_check_handle ();
2549
2546
bool active = uv_is_active (
@@ -2626,7 +2623,8 @@ void SetupProcessObject(Environment* env,
2626
2623
2627
2624
process->SetAccessor (env->title_string (),
2628
2625
ProcessTitleGetter,
2629
- ProcessTitleSetter);
2626
+ ProcessTitleSetter,
2627
+ env->as_external ());
2630
2628
2631
2629
// process.version
2632
2630
READONLY_PROPERTY (process,
@@ -2741,15 +2739,16 @@ void SetupProcessObject(Environment* env,
2741
2739
EnvQuery,
2742
2740
EnvDeleter,
2743
2741
EnvEnumerator,
2744
- Object::New ( env->isolate () ));
2742
+ env->as_external ( ));
2745
2743
Local<Object> process_env = process_env_template->NewInstance ();
2746
2744
process->Set (env->env_string (), process_env);
2747
2745
2748
2746
READONLY_PROPERTY (process, " pid" , Integer::New (env->isolate (), getpid ()));
2749
2747
READONLY_PROPERTY (process, " features" , GetFeatures (env));
2750
2748
process->SetAccessor (env->need_imm_cb_string (),
2751
- NeedImmediateCallbackGetter,
2752
- NeedImmediateCallbackSetter);
2749
+ NeedImmediateCallbackGetter,
2750
+ NeedImmediateCallbackSetter,
2751
+ env->as_external ());
2753
2752
2754
2753
// -e, --eval
2755
2754
if (eval_string) {
@@ -2812,7 +2811,8 @@ void SetupProcessObject(Environment* env,
2812
2811
2813
2812
process->SetAccessor (env->debug_port_string (),
2814
2813
DebugPortGetter,
2815
- DebugPortSetter);
2814
+ DebugPortSetter,
2815
+ env->as_external ());
2816
2816
2817
2817
// define various internal methods
2818
2818
env->SetMethod (process,
0 commit comments