From 2fa0096821cd04334210fcae6f54f85d304dc17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 11 Feb 2022 13:41:56 +0100 Subject: compat: support --compat in web workers (#13629) Adds another callback to WebWorkerOptions that allows to execute some modules before actual worker code executes. This allows to set up Node global using std/node. --- runtime/examples/hello_runtime.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/examples/hello_runtime.rs') diff --git a/runtime/examples/hello_runtime.rs b/runtime/examples/hello_runtime.rs index 74a9ef398..e74920c34 100644 --- a/runtime/examples/hello_runtime.rs +++ b/runtime/examples/hello_runtime.rs @@ -22,6 +22,9 @@ async fn main() -> Result<(), AnyError> { let create_web_worker_cb = Arc::new(|_| { todo!("Web workers are not supported in the example"); }); + let web_worker_preload_module_cb = Arc::new(|_| { + todo!("Web workers are not supported in the example"); + }); let options = WorkerOptions { bootstrap: BootstrapOptions { @@ -42,6 +45,7 @@ async fn main() -> Result<(), AnyError> { user_agent: "hello_runtime".to_string(), seed: None, js_error_create_fn: None, + web_worker_preload_module_cb, create_web_worker_cb, maybe_inspector_server: None, should_break_on_first_statement: false, -- cgit v1.2.3