Skip to content

Commit 14c3af7

Browse files
addaleaxtargos
authored andcommitted
src: only open HandleScope when necessary
PR-URL: #26734 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
1 parent ad5d8e3 commit 14c3af7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/api/callback.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ InternalCallbackScope::~InternalCallbackScope() {
7979
void InternalCallbackScope::Close() {
8080
if (closed_) return;
8181
closed_ = true;
82-
HandleScope handle_scope(env_->isolate());
8382

8483
if (!env_->can_call_into_js()) return;
8584
if (failed_ && !env_->is_main_thread() && env_->is_stopping()) {
@@ -117,6 +116,7 @@ void InternalCallbackScope::Close() {
117116
return;
118117
}
119118

119+
HandleScope handle_scope(env_->isolate());
120120
Local<Object> process = env_->process_object();
121121

122122
if (!env_->can_call_into_js()) return;

0 commit comments

Comments
 (0)