diff options
Diffstat (limited to 'src/node_process_events.cc')
-rw-r--r-- | src/node_process_events.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/node_process_events.cc b/src/node_process_events.cc index d192ef19b7a..1b902949e26 100644 --- a/src/node_process_events.cc +++ b/src/node_process_events.cc @@ -24,10 +24,14 @@ MaybeLocal<Value> ProcessEmit(Environment* env, const char* event, Local<Value> message) { // Send message to enable debug in cluster workers - Local<Object> process = env->process_object(); Isolate* isolate = env->isolate(); - Local<Value> argv[] = {OneByteString(isolate, event), message}; + Local<String> event_string; + if (!String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>(event)) + .ToLocal(&event_string)) return MaybeLocal<Value>(); + + Local<Object> process = env->process_object(); + Local<Value> argv[] = {event_string, message}; return MakeCallback(isolate, process, "emit", arraysize(argv), argv, {0, 0}); } |