Skip to content

Commit

Permalink
src: only open HandleScope when necessary
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
addaleax authored and BridgeAR committed Mar 21, 2019
1 parent d812dbb commit bca23f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/callback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ InternalCallbackScope::~InternalCallbackScope() {
void InternalCallbackScope::Close() {
if (closed_) return;
closed_ = true;
HandleScope handle_scope(env_->isolate());

if (!env_->can_call_into_js()) return;
if (failed_ && !env_->is_main_thread() && env_->is_stopping()) {
Expand Down Expand Up @@ -117,6 +116,7 @@ void InternalCallbackScope::Close() {
return;
}

HandleScope handle_scope(env_->isolate());
Local<Object> process = env_->process_object();

if (!env_->can_call_into_js()) return;
Expand Down

0 comments on commit bca23f2

Please sign in to comment.