src: only open HandleScope when necessary · nodejs/node@14c3af7 (original) (raw)

Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ InternalCallbackScope::~InternalCallbackScope() {
79 79 void InternalCallbackScope::Close() {
80 80 if (closed_) return;
81 81 closed_ = true;
82 - HandleScope handle_scope(env_->isolate());
83 82
84 83 if (!env_->can_call_into_js()) return;
85 84 if (failed_ && !env_->is_main_thread() && env_->is_stopping()) {
@@ -117,6 +116,7 @@ void InternalCallbackScope::Close() {
117 116 return;
118 117 }
119 118
119 + HandleScope handle_scope(env_->isolate());
120 120 Local process = env_->process_object();
121 121
122 122 if (!env_->can_call_into_js()) return;