Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void InitThreadLocalOnce() {
}

void TrackingTraceStateObserver::UpdateTraceCategoryState() {
if (!env_->owns_process_state()) {
if (!env_->owns_process_state() || !env_->can_call_into_js()) {
// Ideally, we’d have a consistent story that treats all threads/Environment
// instances equally here. However, tracing is essentially global, and this
// callback is called from whichever thread calls `StartTracing()` or
Expand All @@ -228,8 +228,7 @@ void TrackingTraceStateObserver::UpdateTraceCategoryState() {
TryCatchScope try_catch(env_);
try_catch.SetVerbose(true);
Local<Value> args[] = {Boolean::New(isolate, async_hooks_enabled)};
cb->Call(env_->context(), Undefined(isolate), arraysize(args), args)
.ToLocalChecked();
USE(cb->Call(env_->context(), Undefined(isolate), arraysize(args), args));
}

void Environment::CreateProperties() {
Expand Down