summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/Cargo.toml2
-rw-r--r--runtime/build.rs1
-rw-r--r--runtime/js/99_main.js2
-rw-r--r--runtime/lib.rs1
-rw-r--r--runtime/web_worker.rs1
-rw-r--r--runtime/worker.rs1
6 files changed, 8 insertions, 0 deletions
diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml
index 5758219d8..c7805b1b1 100644
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -18,6 +18,7 @@ name = "hello_runtime"
path = "examples/hello_runtime.rs"
[build-dependencies]
+deno_broadcast_channel = { path = "../extensions/broadcast_channel", version = "0.1.0" }
deno_console = { version = "0.7.0", path = "../extensions/console" }
deno_core = { version = "0.88.0", path = "../core" }
deno_crypto = { version = "0.21.0", path = "../extensions/crypto" }
@@ -36,6 +37,7 @@ winres = "0.1.11"
winapi = "0.3.9"
[dependencies]
+deno_broadcast_channel = { path = "../extensions/broadcast_channel", version = "0.1.0" }
deno_console = { version = "0.7.0", path = "../extensions/console" }
deno_core = { version = "0.88.0", path = "../core" }
deno_crypto = { version = "0.21.0", path = "../extensions/crypto" }
diff --git a/runtime/build.rs b/runtime/build.rs
index e1cae7195..4fe89af3e 100644
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -52,6 +52,7 @@ fn create_runtime_snapshot(snapshot_path: &Path, files: Vec<PathBuf>) {
deno_crypto::init(None),
deno_webgpu::init(false),
deno_timers::init::<deno_timers::NoTimersPermission>(),
+ deno_broadcast_channel::init(),
];
let js_runtime = JsRuntime::new(RuntimeOptions {
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 796d5178f..e1c474c28 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -29,6 +29,7 @@ delete Object.prototype.__proto__;
const webgpu = window.__bootstrap.webgpu;
const webSocket = window.__bootstrap.webSocket;
const webStorage = window.__bootstrap.webStorage;
+ const broadcastChannel = window.__bootstrap.broadcastChannel;
const file = window.__bootstrap.file;
const formData = window.__bootstrap.formData;
const fetch = window.__bootstrap.fetch;
@@ -282,6 +283,7 @@ delete Object.prototype.__proto__;
URL: util.nonEnumerable(url.URL),
URLSearchParams: util.nonEnumerable(url.URLSearchParams),
WebSocket: util.nonEnumerable(webSocket.WebSocket),
+ BroadcastChannel: util.nonEnumerable(broadcastChannel.BroadcastChannel),
Worker: util.nonEnumerable(worker.Worker),
WritableStream: util.nonEnumerable(streams.WritableStream),
WritableStreamDefaultWriter: util.nonEnumerable(
diff --git a/runtime/lib.rs b/runtime/lib.rs
index d45a72727..3cc73bfff 100644
--- a/runtime/lib.rs
+++ b/runtime/lib.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+pub use deno_broadcast_channel;
pub use deno_console;
pub use deno_crypto;
pub use deno_fetch;
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 5b731a0f5..172d24dea 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -268,6 +268,7 @@ impl WebWorker {
options.user_agent.clone(),
options.ca_data.clone(),
),
+ deno_broadcast_channel::init(),
deno_crypto::init(options.seed),
deno_webgpu::init(options.unstable),
deno_timers::init::<Permissions>(),
diff --git a/runtime/worker.rs b/runtime/worker.rs
index c75f09dc8..b41f0291c 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -107,6 +107,7 @@ impl MainWorker {
),
deno_webstorage::init(options.location_data_dir.clone()),
deno_crypto::init(options.seed),
+ deno_broadcast_channel::init(),
deno_webgpu::init(options.unstable),
deno_timers::init::<Permissions>(),
// Metrics