summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-10-12 17:55:50 +0200
committerGitHub <noreply@github.com>2023-10-12 15:55:50 +0000
commitc464cd7073c761780b3170a48542c387560e3f26 (patch)
tree881a26d05423f9c696c8f35ce8bd2d72d562b1ea /runtime/web_worker.rs
parent5dd010a4fbeb0602891ea537b98216b8ad7d27a7 (diff)
refactor: FeatureChecker integration in ext/ crates (#20797)
Towards https://github.com/denoland/deno/issues/20779.
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r--runtime/web_worker.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index f37a77d88..c1fe5a619 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -25,6 +25,7 @@ use deno_core::v8;
use deno_core::CancelHandle;
use deno_core::CompiledWasmModuleStore;
use deno_core::Extension;
+use deno_core::FeatureChecker;
use deno_core::GetErrorClassFn;
use deno_core::JsRuntime;
use deno_core::ModuleCode;
@@ -349,6 +350,7 @@ pub struct WebWorkerOptions {
pub compiled_wasm_module_store: Option<CompiledWasmModuleStore>,
pub cache_storage_dir: Option<std::path::PathBuf>,
pub stdio: Stdio,
+ pub feature_checker: Arc<FeatureChecker>,
}
impl WebWorker {
@@ -385,7 +387,6 @@ impl WebWorker {
);
// Permissions: many ops depend on this
- let unstable = options.bootstrap.unstable;
let enable_testing_features = options.bootstrap.enable_testing_features;
let create_cache = options.cache_storage_dir.map(|storage_dir| {
let create_cache_fn = move || SqliteBackedCache::new(storage_dir.clone());
@@ -509,17 +510,10 @@ impl WebWorker {
extensions,
inspector: options.maybe_inspector_server.is_some(),
preserve_snapshotted_modules,
+ feature_checker: Some(options.feature_checker.clone()),
..Default::default()
});
- if unstable {
- let op_state = js_runtime.op_state();
- op_state
- .borrow_mut()
- .feature_checker
- .enable_legacy_unstable();
- }
-
if let Some(server) = options.maybe_inspector_server.clone() {
server.register_inspector(
main_module.to_string(),