Skip to content

Commit

Permalink
Register a message handler
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Mar 12, 2024
1 parent ad6b00a commit 4f0d25b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,16 @@ impl MainWorker {
js_runtime.op_state().borrow_mut().put(op_summary_metrics);
}

extern "C" fn message_handler(
_msg: v8::Local<v8::Message>,
_exception: v8::Local<v8::Value>,
) {
// ...
}

// Register message listener
js_runtime.v8_isolate().add_message_listener(message_handler);

if let Some(server) = options.maybe_inspector_server.clone() {
server.register_inspector(
main_module.to_string(),
Expand Down

0 comments on commit 4f0d25b

Please sign in to comment.