diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-09-12 22:27:16 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-12 12:27:16 +0000 |
commit | 9e8f84214f88ae725f9a028f615b19546b9d789f (patch) | |
tree | 5a1ef949e6fd541ecc5bcf16e3bc61fbd5b6b6e7 /ext/ffi | |
parent | b0265eaf8f1d42ec983c2fef0d78435239442ddc (diff) |
refactor: cleanup unstable checks for WebGPU, FFI and FS APIs (#25586)
Continuation of work in #25488.
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Diffstat (limited to 'ext/ffi')
-rw-r--r-- | ext/ffi/call.rs | 3 | ||||
-rw-r--r-- | ext/ffi/callback.rs | 2 | ||||
-rw-r--r-- | ext/ffi/dlfcn.rs | 2 | ||||
-rw-r--r-- | ext/ffi/lib.rs | 9 | ||||
-rw-r--r-- | ext/ffi/repr.rs | 37 |
5 files changed, 0 insertions, 53 deletions
diff --git a/ext/ffi/call.rs b/ext/ffi/call.rs index 916597293..380fc03a1 100644 --- a/ext/ffi/call.rs +++ b/ext/ffi/call.rs @@ -1,7 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use crate::callback::PtrSymbol; -use crate::check_unstable; use crate::dlfcn::DynamicLibraryResource; use crate::ir::*; use crate::symbol::NativeType; @@ -285,7 +284,6 @@ pub fn op_ffi_call_ptr_nonblocking<FP>( where FP: FfiPermissions + 'static, { - check_unstable(&state.borrow(), "Deno.UnsafeFnPointer#call"); { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::<FP>(); @@ -383,7 +381,6 @@ pub fn op_ffi_call_ptr<FP>( where FP: FfiPermissions + 'static, { - check_unstable(&state.borrow(), "Deno.UnsafeFnPointer#call"); { let mut state = state.borrow_mut(); let permissions = state.borrow_mut::<FP>(); diff --git a/ext/ffi/callback.rs b/ext/ffi/callback.rs index 281208322..7d0114131 100644 --- a/ext/ffi/callback.rs +++ b/ext/ffi/callback.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::check_unstable; use crate::symbol::NativeType; use crate::FfiPermissions; use crate::ForeignFunction; @@ -557,7 +556,6 @@ pub fn op_ffi_unsafe_callback_create<FP, 'scope>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafeCallback"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; diff --git a/ext/ffi/dlfcn.rs b/ext/ffi/dlfcn.rs index 261a62cd3..2bae5d223 100644 --- a/ext/ffi/dlfcn.rs +++ b/ext/ffi/dlfcn.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::check_unstable; use crate::ir::out_buffer_as_ptr; use crate::symbol::NativeType; use crate::symbol::Symbol; @@ -124,7 +123,6 @@ where { let path = args.path; - check_unstable(state, "Deno.dlopen"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(Some(&PathBuf::from(&path)))?; diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 26b06d98f..59d241c5a 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -1,7 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use deno_core::error::AnyError; -use deno_core::OpState; use std::mem::size_of; use std::os::raw::c_char; @@ -41,14 +40,6 @@ const _: () = { pub const UNSTABLE_FEATURE_NAME: &str = "ffi"; -fn check_unstable(state: &OpState, api_name: &str) { - // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` - // once we phase out `check_or_exit_with_legacy_fallback` - state - .feature_checker - .check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, api_name) -} - pub trait FfiPermissions { fn check_partial(&mut self, path: Option<&Path>) -> Result<(), AnyError>; } diff --git a/ext/ffi/repr.rs b/ext/ffi/repr.rs index c3656f0fe..f56537475 100644 --- a/ext/ffi/repr.rs +++ b/ext/ffi/repr.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::check_unstable; use crate::FfiPermissions; use deno_core::error::range_error; use deno_core::error::type_error; @@ -21,7 +20,6 @@ pub fn op_ffi_ptr_create<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointer#create"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -37,7 +35,6 @@ pub fn op_ffi_ptr_equals<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointer#equals"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -52,7 +49,6 @@ pub fn op_ffi_ptr_of<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointer#of"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -67,7 +63,6 @@ pub fn op_ffi_ptr_of_exact<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointer#of"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -89,7 +84,6 @@ pub fn op_ffi_ptr_offset<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointer#offset"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -120,7 +114,6 @@ pub fn op_ffi_ptr_value<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointer#value"); let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -138,8 +131,6 @@ pub fn op_ffi_get_buf<FP, 'scope>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getArrayBuffer"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -172,8 +163,6 @@ pub fn op_ffi_buf_copy_into<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#copyInto"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -205,8 +194,6 @@ pub fn op_ffi_cstr_read<FP, 'scope>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getCString"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -233,8 +220,6 @@ pub fn op_ffi_read_bool<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getBool"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -255,8 +240,6 @@ pub fn op_ffi_read_u8<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getUint8"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -279,8 +262,6 @@ pub fn op_ffi_read_i8<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getInt8"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -303,8 +284,6 @@ pub fn op_ffi_read_u16<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getUint16"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -327,8 +306,6 @@ pub fn op_ffi_read_i16<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getInt16"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -351,8 +328,6 @@ pub fn op_ffi_read_u32<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getUint32"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -373,8 +348,6 @@ pub fn op_ffi_read_i32<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getInt32"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -398,8 +371,6 @@ pub fn op_ffi_read_u64<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getBigUint64"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -426,8 +397,6 @@ pub fn op_ffi_read_i64<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getBigInt64"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -451,8 +420,6 @@ pub fn op_ffi_read_f32<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getFloat32"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -473,8 +440,6 @@ pub fn op_ffi_read_f64<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getFloat64"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; @@ -495,8 +460,6 @@ pub fn op_ffi_read_ptr<FP>( where FP: FfiPermissions + 'static, { - check_unstable(state, "Deno.UnsafePointerView#getPointer"); - let permissions = state.borrow_mut::<FP>(); permissions.check_partial(None)?; |