vm: remove unnecessary HandleScopes
authorBen Noordhuis <info@bnoordhuis.nl>
Tue, 16 Jun 2015 14:11:51 +0000 (16:11 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 17 Jun 2015 15:49:52 +0000 (17:49 +0200)
The accessors run inside an implicit HandleScope, there is no need to
create a new one.

PR-URL: https://github.com/nodejs/io.js/pull/2001
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
src/node_contextify.cc

index 81d0388..b52062e 100644 (file)
@@ -362,7 +362,6 @@ class ContextifyContext {
       Local<String> property,
       const PropertyCallbackInfo<Value>& args) {
     Isolate* isolate = args.GetIsolate();
-    HandleScope scope(isolate);
 
     ContextifyContext* ctx =
         Unwrap<ContextifyContext>(args.Data().As<Object>());
@@ -387,7 +386,6 @@ class ContextifyContext {
       Local<Value> value,
       const PropertyCallbackInfo<Value>& args) {
     Isolate* isolate = args.GetIsolate();
-    HandleScope scope(isolate);
 
     ContextifyContext* ctx =
         Unwrap<ContextifyContext>(args.Data().As<Object>());
@@ -400,7 +398,6 @@ class ContextifyContext {
       Local<String> property,
       const PropertyCallbackInfo<Integer>& args) {
     Isolate* isolate = args.GetIsolate();
-    HandleScope scope(isolate);
 
     ContextifyContext* ctx =
         Unwrap<ContextifyContext>(args.Data().As<Object>());
@@ -422,7 +419,6 @@ class ContextifyContext {
       Local<String> property,
       const PropertyCallbackInfo<Boolean>& args) {
     Isolate* isolate = args.GetIsolate();
-    HandleScope scope(isolate);
 
     ContextifyContext* ctx =
         Unwrap<ContextifyContext>(args.Data().As<Object>());
@@ -435,8 +431,6 @@ class ContextifyContext {
 
   static void GlobalPropertyEnumeratorCallback(
       const PropertyCallbackInfo<Array>& args) {
-    HandleScope scope(args.GetIsolate());
-
     ContextifyContext* ctx =
         Unwrap<ContextifyContext>(args.Data().As<Object>());