deno/runtime/ops/mod.rs
snek 25b9abcdf8
feat: use new feature checker (#29091)
we need to be able to set the feature checker after creating the runtime
to support lazy init
2025-04-29 17:18:14 +02:00

24 lines
547 B
Rust

// Copyright 2018-2025 the Deno authors. MIT license.
pub mod bootstrap;
pub mod fs_events;
pub mod http;
pub mod permissions;
pub mod runtime;
pub mod tty;
pub mod web_worker;
pub mod worker_host;
use std::sync::Arc;
use deno_core::OpState;
use deno_features::FeatureChecker;
/// Helper for checking unstable features. Used for sync ops.
pub fn check_unstable(state: &OpState, feature: &str, api_name: &str) {
state
.borrow::<Arc<FeatureChecker>>()
.check_or_exit(feature, api_name);
}
pub struct TestingFeaturesEnabled(pub bool);