diff options
Diffstat (limited to 'ext/ffi/lib.rs')
-rw-r--r-- | ext/ffi/lib.rs | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index b5a2a3bd5..1ca921119 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -45,22 +45,10 @@ const _: () = { pub(crate) const MAX_SAFE_INTEGER: isize = 9007199254740991; pub(crate) const MIN_SAFE_INTEGER: isize = -9007199254740991; -pub struct Unstable(pub bool); - fn check_unstable(state: &OpState, api_name: &str) { - let unstable = state.borrow::<Unstable>(); - - if !unstable.0 { - eprintln!( - "Unstable API '{api_name}'. The --unstable flag must be provided." - ); - std::process::exit(70); - } -} - -pub fn check_unstable2(state: &Rc<RefCell<OpState>>, api_name: &str) { - let state = state.borrow(); - check_unstable(&state, api_name) + state + .feature_checker + .check_legacy_unstable_or_exit(api_name); } pub trait FfiPermissions { @@ -108,13 +96,6 @@ deno_core::extension!(deno_ffi, op_ffi_unsafe_callback_ref, ], esm = [ "00_ffi.js" ], - options = { - unstable: bool, - }, - state = |state, options| { - // Stolen from deno_webgpu, is there a better option? - state.put(Unstable(options.unstable)); - }, event_loop_middleware = event_loop_middleware, ); |