|
90 | 90 | #include <unicode/uvernum.h> |
91 | 91 | #endif |
92 | 92 |
|
| 93 | +#if defined(NODE_REPORT) |
| 94 | +#include "node_report.h" |
| 95 | +#endif |
| 96 | + |
93 | 97 | #if defined(LEAK_SANITIZER) |
94 | 98 | #include <sanitizer/lsan_interface.h> |
95 | 99 | #endif |
@@ -2332,6 +2336,14 @@ void LoadEnvironment(Environment* env) { |
2332 | 2336 | return; |
2333 | 2337 | } |
2334 | 2338 |
|
| 2339 | +#if defined(NODE_REPORT) |
| 2340 | + auto env_opts = per_process_opts->per_isolate->per_env; |
| 2341 | + if (!env_opts->report_events.empty()) { |
| 2342 | + nodereport::InitializeNodeReport(); |
| 2343 | + nodereport::SetEvents(env->isolate(), env_opts->report_events.c_str()); |
| 2344 | + } |
| 2345 | +#endif // NODE_REPORT |
| 2346 | + |
2335 | 2347 | // Bootstrap Node.js |
2336 | 2348 | Local<Object> bootstrapper = Object::New(env->isolate()); |
2337 | 2349 | SetupBootstrapObject(env, bootstrapper); |
@@ -2647,6 +2659,18 @@ void ProcessArgv(std::vector<std::string>* args, |
2647 | 2659 | exit(9); |
2648 | 2660 | } |
2649 | 2661 |
|
| 2662 | +#if defined(NODE_REPORT) |
| 2663 | + if (!env_opts->report_events.empty()) { |
| 2664 | + size_t pos = 0; |
| 2665 | + std::string& temp = env_opts->report_events; |
| 2666 | + while ((pos = temp.find(",", pos)) != std::string::npos) { |
| 2667 | + temp.replace(pos, 1, "+"); |
| 2668 | + pos += 1; |
| 2669 | + } |
| 2670 | + env_opts->report_events = temp; |
| 2671 | + } |
| 2672 | +#endif // NODE_REPORT |
| 2673 | + |
2650 | 2674 | #if HAVE_OPENSSL |
2651 | 2675 | if (per_process_opts->use_openssl_ca && per_process_opts->use_bundled_ca) { |
2652 | 2676 | fprintf(stderr, "%s: either --use-openssl-ca or --use-bundled-ca can be " |
|
0 commit comments