summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-02-06 00:58:06 +0100
committerGitHub <noreply@github.com>2024-02-06 00:58:06 +0100
commit6853633f7d4c66eeffd98a2b6184cd5caa4e9c98 (patch)
tree9fc54845095ac7931024434487f6d5020d5ea8bd /runtime/worker.rs
parentb94dabdb8175e065ec298e4660cc41703148424c (diff)
refactor: don't expose worker ops to user code (#22276)
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index e6da93d78..449c50e10 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -430,6 +430,11 @@ impl MainWorker {
enable_testing_features,
),
runtime::init_ops_and_esm(),
+ // NOTE(bartlomieju): this is done, just so that ops from this extension
+ // are available and importing them in `99_main.js` doesn't cause an
+ // error because they're not defined. Trying to use these ops in non-worker
+ // context will cause a panic.
+ ops::web_worker::deno_web_worker::init_ops_and_esm().disable(),
];
#[cfg(__runtime_js_sources)]