Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspector: only write coverage in fully bootstrapped Environments #32960

Closed
wants to merge 1 commit into from
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
10 changes: 10 additions & 0 deletions src/inspector_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ void V8CoverageConnection::WriteProfile(Local<String> message) {
HandleScope handle_scope(isolate);
Context::Scope context_scope(context);

// This is only set up during pre-execution (when the environment variables
// becomes available in the JS land). If it's empty, we don't have coverage
// directory path (which is resolved in JS land at the moment) either, so
// the best we could to is to just discard the profile and do nothing.
// This should only happen in half-baked Environments created using the
// embedder API.
if (env_->source_map_cache_getter().IsEmpty()) {
return;
}

// Get message.result from the response.
Local<Object> result;
if (!ParseProfile(env_, message, type()).ToLocal(&result)) {
Expand Down