From 0a3bcdd26108bb29045a557bc555c3a53c244a55 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 8 Mar 2019 09:34:46 +0100 Subject: src: refactor coverage connection - Refactor the C++ class to be resuable for other types of profiles - Move the try-catch block around coverage collection callback to be inside the callback to silence potential JSON or write errors. - Use Function::Call instead of MakeCallback to call the coverage message callback since it does not actually need async hook handling. This way we no longer needs to disable the async hooks when writing the coverage results. - Renames `lib/internal/coverage-gen/with_profiler.js` to `lib/internal/profiler.js` because it is now the only way to generate coverage. PR-URL: https://github.com/nodejs/node/pull/26513 Reviewed-By: Anna Henningsen Reviewed-By: Ben Coe --- src/node_binding.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/node_binding.cc') diff --git a/src/node_binding.cc b/src/node_binding.cc index 7b87ba6bff..9599cf956b 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -23,9 +23,9 @@ #endif #if HAVE_INSPECTOR -#define NODE_BUILTIN_COVERAGE_MODULES(V) V(coverage) +#define NODE_BUILTIN_PROFILER_MODULES(V) V(profiler) #else -#define NODE_BUILTIN_COVERAGE_MODULES(V) +#define NODE_BUILTIN_PROFILER_MODULES(V) #endif // A list of built-in modules. In order to do module registration @@ -85,7 +85,7 @@ NODE_BUILTIN_OPENSSL_MODULES(V) \ NODE_BUILTIN_ICU_MODULES(V) \ NODE_BUILTIN_REPORT_MODULES(V) \ - NODE_BUILTIN_COVERAGE_MODULES(V) + NODE_BUILTIN_PROFILER_MODULES(V) // This is used to load built-in modules. Instead of using // __attribute__((constructor)), we call the _register_ -- cgit v1.2.3