@@ -845,8 +845,8 @@ Local<Value> WinapiErrnoException(int errorno,
845845
846846
847847void SetupAsyncListener (const FunctionCallbackInfo<Value>& args) {
848- Environment* env = Environment::GetCurrent (args.GetIsolate ());
849848 HandleScope handle_scope (args.GetIsolate ());
849+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
850850
851851 assert (args[0 ]->IsObject ());
852852 assert (args[1 ]->IsFunction ());
@@ -875,8 +875,8 @@ void SetupAsyncListener(const FunctionCallbackInfo<Value>& args) {
875875
876876
877877void SetupNextTick (const FunctionCallbackInfo<Value>& args) {
878- Environment* env = Environment::GetCurrent (args.GetIsolate ());
879878 HandleScope handle_scope (args.GetIsolate ());
879+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
880880
881881 assert (args[0 ]->IsObject () && args[1 ]->IsFunction ());
882882
@@ -1648,8 +1648,8 @@ static void Uptime(const FunctionCallbackInfo<Value>& args) {
16481648
16491649
16501650void MemoryUsage (const FunctionCallbackInfo<Value>& args) {
1651- Environment* env = Environment::GetCurrent (args.GetIsolate ());
16521651 HandleScope handle_scope (args.GetIsolate ());
1652+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
16531653
16541654 size_t rss;
16551655 int err = uv_resident_set_memory (&rss);
@@ -1728,8 +1728,8 @@ typedef void (UV_DYNAMIC* extInit)(Handle<Object> exports);
17281728// when two contexts try to load the same shared object. Maybe have a shadow
17291729// cache that's a plain C list or hash table that's shared across contexts?
17301730void DLOpen (const FunctionCallbackInfo<Value>& args) {
1731- Environment* env = Environment::GetCurrent (args.GetIsolate ());
17321731 HandleScope handle_scope (args.GetIsolate ());
1732+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
17331733 char symbol[1024 ], *base, *pos;
17341734 uv_lib_t lib;
17351735 int r;
@@ -1898,8 +1898,8 @@ void OnMessage(Handle<Message> message, Handle<Value> error) {
18981898
18991899
19001900static void Binding (const FunctionCallbackInfo<Value>& args) {
1901- Environment* env = Environment::GetCurrent (args.GetIsolate ());
19021901 HandleScope handle_scope (args.GetIsolate ());
1902+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
19031903
19041904 Local<String> module = args[0 ]->ToString ();
19051905 String::Utf8Value module_v (module );
@@ -2181,6 +2181,7 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args);
21812181
21822182void NeedImmediateCallbackGetter (Local<String> property,
21832183 const PropertyCallbackInfo<Value>& info) {
2184+ HandleScope handle_scope (info.GetIsolate ());
21842185 Environment* env = Environment::GetCurrent (info.GetIsolate ());
21852186 const uv_check_t * immediate_check_handle = env->immediate_check_handle ();
21862187 bool active = uv_is_active (
@@ -2193,8 +2194,8 @@ static void NeedImmediateCallbackSetter(
21932194 Local<String> property,
21942195 Local<Value> value,
21952196 const PropertyCallbackInfo<void >& info) {
2196- Environment* env = Environment::GetCurrent (info.GetIsolate ());
21972197 HandleScope handle_scope (info.GetIsolate ());
2198+ Environment* env = Environment::GetCurrent (info.GetIsolate ());
21982199
21992200 uv_check_t * immediate_check_handle = env->immediate_check_handle ();
22002201 bool active = uv_is_active (
@@ -2241,12 +2242,16 @@ void StopProfilerIdleNotifier(Environment* env) {
22412242
22422243
22432244void StartProfilerIdleNotifier (const FunctionCallbackInfo<Value>& args) {
2244- StartProfilerIdleNotifier (Environment::GetCurrent (args.GetIsolate ()));
2245+ HandleScope handle_scope (args.GetIsolate ());
2246+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
2247+ StartProfilerIdleNotifier (env);
22452248}
22462249
22472250
22482251void StopProfilerIdleNotifier (const FunctionCallbackInfo<Value>& args) {
2249- StopProfilerIdleNotifier (Environment::GetCurrent (args.GetIsolate ()));
2252+ HandleScope handle_scope (args.GetIsolate ());
2253+ Environment* env = Environment::GetCurrent (args.GetIsolate ());
2254+ StopProfilerIdleNotifier (env);
22502255}
22512256
22522257
@@ -2761,6 +2766,7 @@ static void EnableDebug(bool wait_connect) {
27612766 assert (debugger_running == false );
27622767 Isolate* isolate = node_isolate; // TODO(bnoordhuis) Multi-isolate support.
27632768 Isolate::Scope isolate_scope (isolate);
2769+ HandleScope handle_scope (isolate);
27642770 v8::Debug::SetDebugMessageDispatchHandler (DispatchMessagesDebugAgentCallback,
27652771 false );
27662772 debugger_running = v8::Debug::EnableAgent (" node " NODE_VERSION,
@@ -2779,7 +2785,6 @@ static void EnableDebug(bool wait_connect) {
27792785 return ; // Still starting up.
27802786
27812787 Context::Scope context_scope (env->context ());
2782- HandleScope handle_scope (env->isolate ());
27832788 Local<Object> message = Object::New ();
27842789 message->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " cmd" ),
27852790 FIXED_ONE_BYTE_STRING (env->isolate (), " NODE_DEBUG_ENABLED" ));
0 commit comments