summaryrefslogtreecommitdiff
path: root/src/node.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/node.cc b/src/node.cc
index 3401ce30b2..6e2327ef51 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -170,6 +170,8 @@ static const unsigned kMaxSignal = 32;
void WaitForInspectorDisconnect(Environment* env) {
#if HAVE_INSPECTOR
+ profiler::EndStartedProfilers(env);
+
if (env->inspector_agent()->IsActive()) {
// Restore signal dispositions, the app is done and is no longer
// capable of handling signals.
@@ -240,13 +242,13 @@ MaybeLocal<Value> RunBootstrapping(Environment* env) {
Isolate* isolate = env->isolate();
Local<Context> context = env->context();
- std::string coverage;
- bool rc = credentials::SafeGetenv("NODE_V8_COVERAGE", &coverage);
- if (rc && !coverage.empty()) {
+ Local<String> coverage_str = env->env_vars()->Get(
+ isolate, FIXED_ONE_BYTE_STRING(isolate, "NODE_V8_COVERAGE"));
+ if (!coverage_str.IsEmpty() && coverage_str->Length() > 0) {
#if HAVE_INSPECTOR
profiler::StartCoverageCollection(env);
#else
- fprintf(stderr, "NODE_V8_COVERAGE cannot be used without inspector");
+ fprintf(stderr, "NODE_V8_COVERAGE cannot be used without inspector\n");
#endif // HAVE_INSPECTOR
}