summaryrefslogtreecommitdiff
path: root/runtime/examples
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-02-11 13:41:56 +0100
committerGitHub <noreply@github.com>2022-02-11 13:41:56 +0100
commit2fa0096821cd04334210fcae6f54f85d304dc17a (patch)
treef4c76302e48861e2d7cf802feab9f3d560fd1c9c /runtime/examples
parent2f2c778a074d0eff991c6c22da54429de3de6704 (diff)
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.
Diffstat (limited to 'runtime/examples')
-rw-r--r--runtime/examples/hello_runtime.rs4
1 files changed, 4 insertions, 0 deletions
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,