@ -2280,7 +2280,7 @@ static void LinkedBinding(const FunctionCallbackInfo<Value>& args) {
static void ProcessTitleGetter ( Local < String > property ,
static void ProcessTitleGetter ( Local < String > property ,
const PropertyCallbackInfo < Value > & info ) {
const PropertyCallbackInfo < Value > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
char buffer [ 512 ] ;
char buffer [ 512 ] ;
uv_get_process_title ( buffer , sizeof ( buffer ) ) ;
uv_get_process_title ( buffer , sizeof ( buffer ) ) ;
@ -2291,7 +2291,7 @@ static void ProcessTitleGetter(Local<String> property,
static void ProcessTitleSetter ( Local < String > property ,
static void ProcessTitleSetter ( Local < String > property ,
Local < Value > value ,
Local < Value > value ,
const PropertyCallbackInfo < void > & info ) {
const PropertyCallbackInfo < void > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
node : : Utf8Value title ( env - > isolate ( ) , value ) ;
node : : Utf8Value title ( env - > isolate ( ) , value ) ;
// TODO(piscisaureus): protect with a lock
// TODO(piscisaureus): protect with a lock
@ -2301,7 +2301,7 @@ static void ProcessTitleSetter(Local<String> property,
static void EnvGetter ( Local < String > property ,
static void EnvGetter ( Local < String > property ,
const PropertyCallbackInfo < Value > & info ) {
const PropertyCallbackInfo < Value > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
# ifdef __POSIX__
# ifdef __POSIX__
node : : Utf8Value key ( env - > isolate ( ) , property ) ;
node : : Utf8Value key ( env - > isolate ( ) , property ) ;
@ -2325,16 +2325,13 @@ static void EnvGetter(Local<String> property,
return info . GetReturnValue ( ) . Set ( rc ) ;
return info . GetReturnValue ( ) . Set ( rc ) ;
}
}
# endif
# endif
// Not found. Fetch from prototype.
info . GetReturnValue ( ) . Set (
info . Data ( ) . As < Object > ( ) - > Get ( property ) ) ;
}
}
static void EnvSetter ( Local < String > property ,
static void EnvSetter ( Local < String > property ,
Local < Value > value ,
Local < Value > value ,
const PropertyCallbackInfo < Value > & info ) {
const PropertyCallbackInfo < Value > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
# ifdef __POSIX__
# ifdef __POSIX__
node : : Utf8Value key ( env - > isolate ( ) , property ) ;
node : : Utf8Value key ( env - > isolate ( ) , property ) ;
@ -2356,7 +2353,7 @@ static void EnvSetter(Local<String> property,
static void EnvQuery ( Local < String > property ,
static void EnvQuery ( Local < String > property ,
const PropertyCallbackInfo < Integer > & info ) {
const PropertyCallbackInfo < Integer > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
int32_t rc = - 1 ; // Not found unless proven otherwise.
int32_t rc = - 1 ; // Not found unless proven otherwise.
# ifdef __POSIX__
# ifdef __POSIX__
@ -2384,7 +2381,7 @@ static void EnvQuery(Local<String> property,
static void EnvDeleter ( Local < String > property ,
static void EnvDeleter ( Local < String > property ,
const PropertyCallbackInfo < Boolean > & info ) {
const PropertyCallbackInfo < Boolean > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
bool rc = true ;
bool rc = true ;
# ifdef __POSIX__
# ifdef __POSIX__
@ -2407,7 +2404,7 @@ static void EnvDeleter(Local<String> property,
static void EnvEnumerator ( const PropertyCallbackInfo < Array > & info ) {
static void EnvEnumerator ( const PropertyCallbackInfo < Array > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
# ifdef __POSIX__
# ifdef __POSIX__
int size = 0 ;
int size = 0 ;
@ -2508,7 +2505,7 @@ static Handle<Object> GetFeatures(Environment* env) {
static void DebugPortGetter ( Local < String > property ,
static void DebugPortGetter ( Local < String > property ,
const PropertyCallbackInfo < Value > & info ) {
const PropertyCallbackInfo < Value > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
info . GetReturnValue ( ) . Set ( debug_port ) ;
info . GetReturnValue ( ) . Set ( debug_port ) ;
}
}
@ -2517,7 +2514,7 @@ static void DebugPortGetter(Local<String> property,
static void DebugPortSetter ( Local < String > property ,
static void DebugPortSetter ( Local < String > property ,
Local < Value > value ,
Local < Value > value ,
const PropertyCallbackInfo < void > & info ) {
const PropertyCallbackInfo < void > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
HandleScope scope ( env - > isolate ( ) ) ;
HandleScope scope ( env - > isolate ( ) ) ;
debug_port = value - > Int32Value ( ) ;
debug_port = value - > Int32Value ( ) ;
}
}
@ -2530,7 +2527,7 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args);
void NeedImmediateCallbackGetter ( Local < String > property ,
void NeedImmediateCallbackGetter ( Local < String > property ,
const PropertyCallbackInfo < Value > & info ) {
const PropertyCallbackInfo < Value > & info ) {
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
const uv_check_t * immediate_check_handle = env - > immediate_check_handle ( ) ;
const uv_check_t * immediate_check_handle = env - > immediate_check_handle ( ) ;
bool active = uv_is_active (
bool active = uv_is_active (
reinterpret_cast < const uv_handle_t * > ( immediate_check_handle ) ) ;
reinterpret_cast < const uv_handle_t * > ( immediate_check_handle ) ) ;
@ -2543,7 +2540,7 @@ static void NeedImmediateCallbackSetter(
Local < Value > value ,
Local < Value > value ,
const PropertyCallbackInfo < void > & info ) {
const PropertyCallbackInfo < void > & info ) {
HandleScope handle_scope ( info . GetIsolate ( ) ) ;
HandleScope handle_scope ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info . GetIsolate ( ) ) ;
Environment * env = Environment : : GetCurrent ( info ) ;
uv_check_t * immediate_check_handle = env - > immediate_check_handle ( ) ;
uv_check_t * immediate_check_handle = env - > immediate_check_handle ( ) ;
bool active = uv_is_active (
bool active = uv_is_active (
@ -2626,7 +2623,8 @@ void SetupProcessObject(Environment* env,
process - > SetAccessor ( env - > title_string ( ) ,
process - > SetAccessor ( env - > title_string ( ) ,
ProcessTitleGetter ,
ProcessTitleGetter ,
ProcessTitleSetter ) ;
ProcessTitleSetter ,
env - > as_external ( ) ) ;
// process.version
// process.version
READONLY_PROPERTY ( process ,
READONLY_PROPERTY ( process ,
@ -2741,7 +2739,7 @@ void SetupProcessObject(Environment* env,
EnvQuery ,
EnvQuery ,
EnvDeleter ,
EnvDeleter ,
EnvEnumerator ,
EnvEnumerator ,
Object : : New ( env - > isolate ( ) ) ) ;
env - > as_external ( ) ) ;
Local < Object > process_env = process_env_template - > NewInstance ( ) ;
Local < Object > process_env = process_env_template - > NewInstance ( ) ;
process - > Set ( env - > env_string ( ) , process_env ) ;
process - > Set ( env - > env_string ( ) , process_env ) ;
@ -2749,7 +2747,8 @@ void SetupProcessObject(Environment* env,
READONLY_PROPERTY ( process , " features " , GetFeatures ( env ) ) ;
READONLY_PROPERTY ( process , " features " , GetFeatures ( env ) ) ;
process - > SetAccessor ( env - > need_imm_cb_string ( ) ,
process - > SetAccessor ( env - > need_imm_cb_string ( ) ,
NeedImmediateCallbackGetter ,
NeedImmediateCallbackGetter ,
NeedImmediateCallbackSetter ) ;
NeedImmediateCallbackSetter ,
env - > as_external ( ) ) ;
// -e, --eval
// -e, --eval
if ( eval_string ) {
if ( eval_string ) {
@ -2812,7 +2811,8 @@ void SetupProcessObject(Environment* env,
process - > SetAccessor ( env - > debug_port_string ( ) ,
process - > SetAccessor ( env - > debug_port_string ( ) ,
DebugPortGetter ,
DebugPortGetter ,
DebugPortSetter ) ;
DebugPortSetter ,
env - > as_external ( ) ) ;
// define various internal methods
// define various internal methods
env - > SetMethod ( process ,
env - > SetMethod ( process ,