diff options
Diffstat (limited to 'ops/op2/test_cases/sync')
24 files changed, 0 insertions, 948 deletions
diff --git a/ops/op2/test_cases/sync/add.out b/ops/op2/test_cases/sync/add.out deleted file mode 100644 index a73f032aa..000000000 --- a/ops/op2/test_cases/sync/add.out +++ /dev/null @@ -1,78 +0,0 @@ -#[allow(non_camel_case_types)] -struct op_add { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_add { - const NAME: &'static str = stringify!(op_add); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_add), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::Uint32, Type::Uint32], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 2usize as u8, - }; -} -impl op_add { - pub const fn name() -> &'static str { - stringify!(op_add) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_add), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::Uint32, Type::Uint32], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 2usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - arg0: u32, - arg1: u32, - ) -> u32 { - let arg0 = arg0 as _; - let arg1 = arg1 as _; - let result = Self::call(arg0, arg1); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let arg0 = args.get(0usize as i32); - let arg0 = deno_core::_ops::to_u32(&arg0) as _; - let arg1 = args.get(1usize as i32); - let arg1 = deno_core::_ops::to_u32(&arg1) as _; - let result = Self::call(arg0, arg1); - rv.set_uint32(result as u32); - } - #[inline(always)] - fn call(a: u32, b: u32) -> u32 { - a + b - } -} diff --git a/ops/op2/test_cases/sync/add.rs b/ops/op2/test_cases/sync/add.rs deleted file mode 100644 index 74dbb1893..000000000 --- a/ops/op2/test_cases/sync/add.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -fn op_add(a: u32, b: u32) -> u32 { - a + b -} diff --git a/ops/op2/test_cases/sync/add_options.out b/ops/op2/test_cases/sync/add_options.out deleted file mode 100644 index 9fada187f..000000000 --- a/ops/op2/test_cases/sync/add_options.out +++ /dev/null @@ -1,57 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_test_add_option { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl crate::_ops::Op for op_test_add_option { - const NAME: &'static str = stringify!(op_test_add_option); - const DECL: crate::_ops::OpDecl = crate::_ops::OpDecl { - name: stringify!(op_test_add_option), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: None, - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 2usize as u8, - }; -} -impl op_test_add_option { - pub const fn name() -> &'static str { - stringify!(op_test_add_option) - } - pub const fn decl() -> crate::_ops::OpDecl { - crate::_ops::OpDecl { - name: stringify!(op_test_add_option), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: None, - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 2usize as u8, - } - } - extern "C" fn v8_fn_ptr(info: *const crate::v8::FunctionCallbackInfo) { - let mut rv = crate::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = crate::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let arg0 = args.get(0usize as i32); - let arg0 = crate::_ops::to_u32(&arg0) as _; - let arg1 = args.get(1usize as i32); - let arg1 = if arg1.is_null_or_undefined() { - None - } else { - let arg1 = crate::_ops::to_u32(&arg1) as _; - Some(arg1) - }; - let result = Self::call(arg0, arg1); - rv.set_uint32(result as u32); - } - #[inline(always)] - pub fn call(a: u32, b: Option<u32>) -> u32 { - a + b.unwrap_or(100) - } -} diff --git a/ops/op2/test_cases/sync/add_options.rs b/ops/op2/test_cases/sync/add_options.rs deleted file mode 100644 index a5f2c8f4a..000000000 --- a/ops/op2/test_cases/sync/add_options.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(core)] -pub fn op_test_add_option(a: u32, b: Option<u32>) -> u32 { - a + b.unwrap_or(100) -} diff --git a/ops/op2/test_cases/sync/doc_comment.out b/ops/op2/test_cases/sync/doc_comment.out deleted file mode 100644 index d7e8005d9..000000000 --- a/ops/op2/test_cases/sync/doc_comment.out +++ /dev/null @@ -1,59 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_has_doc_comment { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_has_doc_comment { - const NAME: &'static str = stringify!(op_has_doc_comment); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_has_doc_comment), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value], - CType::Void, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - }; -} -impl op_has_doc_comment { - pub const fn name() -> &'static str { - stringify!(op_has_doc_comment) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_has_doc_comment), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value], - CType::Void, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - } - } - fn v8_fn_ptr_fast(_: deno_core::v8::Local<deno_core::v8::Object>) -> () { - let result = Self::call(); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let result = Self::call(); - } - #[inline(always)] - pub fn call() -> () {} -} diff --git a/ops/op2/test_cases/sync/doc_comment.rs b/ops/op2/test_cases/sync/doc_comment.rs deleted file mode 100644 index b729a64bd..000000000 --- a/ops/op2/test_cases/sync/doc_comment.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -/// This is a doc comment. -#[op2(fast)] -pub fn op_has_doc_comment() -> () {} diff --git a/ops/op2/test_cases/sync/generics.out b/ops/op2/test_cases/sync/generics.out deleted file mode 100644 index 26e3af9b7..000000000 --- a/ops/op2/test_cases/sync/generics.out +++ /dev/null @@ -1,59 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_generics<T> { - _unconstructable: ::std::marker::PhantomData<(T)>, -} -impl<T: Trait> deno_core::_ops::Op for op_generics<T> { - const NAME: &'static str = stringify!(op_generics); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_generics), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value], - CType::Void, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - }; -} -impl<T: Trait> op_generics<T> { - pub const fn name() -> &'static str { - stringify!(op_generics) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_generics), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value], - CType::Void, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - } - } - fn v8_fn_ptr_fast(_: deno_core::v8::Local<deno_core::v8::Object>) -> () { - let result = Self::call(); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let result = Self::call(); - } - #[inline(always)] - pub fn call() {} -} diff --git a/ops/op2/test_cases/sync/generics.rs b/ops/op2/test_cases/sync/generics.rs deleted file mode 100644 index b412a7f93..000000000 --- a/ops/op2/test_cases/sync/generics.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -pub fn op_generics<T: Trait>() {} diff --git a/ops/op2/test_cases/sync/result_primitive.out b/ops/op2/test_cases/sync/result_primitive.out deleted file mode 100644 index 4f296a893..000000000 --- a/ops/op2/test_cases/sync/result_primitive.out +++ /dev/null @@ -1,122 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_u32_with_result { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_u32_with_result { - const NAME: &'static str = stringify!(op_u32_with_result); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_u32_with_result), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::CallbackOptions], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - }; -} -impl op_u32_with_result { - pub const fn name() -> &'static str { - stringify!(op_u32_with_result) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_u32_with_result), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::CallbackOptions], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions, - ) -> u32 { - let fast_api_callback_options = unsafe { &mut *fast_api_callback_options }; - let opctx = unsafe { - &*(deno_core::v8::Local::< - v8::External, - >::cast(unsafe { fast_api_callback_options.data.data }) - .value() as *const deno_core::_ops::OpCtx) - }; - let result = Self::call(); - let result = match result { - Ok(result) => result, - Err(err) => { - unsafe { - opctx.unsafely_set_last_error_for_ops_only(err); - } - fast_api_callback_options.fallback = true; - return ::std::default::Default::default(); - } - }; - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let opctx = unsafe { - &*(deno_core::v8::Local::<deno_core::v8::External>::cast(args.data()).value() - as *const deno_core::_ops::OpCtx) - }; - if let Some(err) = unsafe { opctx.unsafely_take_last_error_for_ops_only() } { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let opstate = ::std::cell::RefCell::borrow(&*opctx.state); - let exception = deno_core::error::to_v8_error( - scope, - opstate.get_error_class_fn, - &err, - ); - scope.throw_exception(exception); - return; - } - let result = Self::call(); - match result { - Ok(result) => { - rv.set_uint32(result as u32); - } - Err(err) => { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let opstate = ::std::cell::RefCell::borrow(&*opctx.state); - let exception = deno_core::error::to_v8_error( - scope, - opstate.get_error_class_fn, - &err, - ); - scope.throw_exception(exception); - return; - } - }; - } - #[inline(always)] - pub fn call() -> Result<u32, AnyError> {} -} diff --git a/ops/op2/test_cases/sync/result_primitive.rs b/ops/op2/test_cases/sync/result_primitive.rs deleted file mode 100644 index df89c2432..000000000 --- a/ops/op2/test_cases/sync/result_primitive.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -pub fn op_u32_with_result() -> Result<u32, AnyError> {} diff --git a/ops/op2/test_cases/sync/result_void.out b/ops/op2/test_cases/sync/result_void.out deleted file mode 100644 index 74aa84a8d..000000000 --- a/ops/op2/test_cases/sync/result_void.out +++ /dev/null @@ -1,117 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_void_with_result { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_void_with_result { - const NAME: &'static str = stringify!(op_void_with_result); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_void_with_result), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::CallbackOptions], - CType::Void, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - }; -} -impl op_void_with_result { - pub const fn name() -> &'static str { - stringify!(op_void_with_result) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_void_with_result), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::CallbackOptions], - CType::Void, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions, - ) -> () { - let fast_api_callback_options = unsafe { &mut *fast_api_callback_options }; - let opctx = unsafe { - &*(deno_core::v8::Local::< - v8::External, - >::cast(unsafe { fast_api_callback_options.data.data }) - .value() as *const deno_core::_ops::OpCtx) - }; - let result = Self::call(); - let result = match result { - Ok(result) => result, - Err(err) => { - unsafe { - opctx.unsafely_set_last_error_for_ops_only(err); - } - fast_api_callback_options.fallback = true; - return ::std::default::Default::default(); - } - }; - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let opctx = unsafe { - &*(deno_core::v8::Local::<deno_core::v8::External>::cast(args.data()).value() - as *const deno_core::_ops::OpCtx) - }; - if let Some(err) = unsafe { opctx.unsafely_take_last_error_for_ops_only() } { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let opstate = ::std::cell::RefCell::borrow(&*opctx.state); - let exception = deno_core::error::to_v8_error( - scope, - opstate.get_error_class_fn, - &err, - ); - scope.throw_exception(exception); - return; - } - let result = Self::call(); - match result { - Ok(result) => {} - Err(err) => { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let opstate = ::std::cell::RefCell::borrow(&*opctx.state); - let exception = deno_core::error::to_v8_error( - scope, - opstate.get_error_class_fn, - &err, - ); - scope.throw_exception(exception); - return; - } - }; - } - #[inline(always)] - pub fn call() -> Result<(), AnyError> {} -} diff --git a/ops/op2/test_cases/sync/result_void.rs b/ops/op2/test_cases/sync/result_void.rs deleted file mode 100644 index ef3aa7b32..000000000 --- a/ops/op2/test_cases/sync/result_void.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -pub fn op_void_with_result() -> Result<(), AnyError> {} diff --git a/ops/op2/test_cases/sync/smi.out b/ops/op2/test_cases/sync/smi.out deleted file mode 100644 index 24b81ae47..000000000 --- a/ops/op2/test_cases/sync/smi.out +++ /dev/null @@ -1,76 +0,0 @@ -#[allow(non_camel_case_types)] -struct op_add { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_add { - const NAME: &'static str = stringify!(op_add); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_add), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::Int32, Type::Uint32], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 2usize as u8, - }; -} -impl op_add { - pub const fn name() -> &'static str { - stringify!(op_add) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_add), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::Int32, Type::Uint32], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 2usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - arg0: i32, - arg1: u32, - ) -> u32 { - let arg0 = arg0 as _; - let arg1 = arg1 as _; - let result = Self::call(arg0, arg1); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let arg0 = args.get(0usize as i32); - let arg0 = deno_core::_ops::to_i32(&arg0) as _; - let arg1 = args.get(1usize as i32); - let arg1 = deno_core::_ops::to_u32(&arg1) as _; - let result = Self::call(arg0, arg1); - rv.set_uint32(result as u32); - } - #[inline(always)] - fn call(id: ResourceId, extra: u16) -> u32 {} -} diff --git a/ops/op2/test_cases/sync/smi.rs b/ops/op2/test_cases/sync/smi.rs deleted file mode 100644 index a5a441845..000000000 --- a/ops/op2/test_cases/sync/smi.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -fn op_add(#[smi] id: ResourceId, extra: u16) -> u32 {} diff --git a/ops/op2/test_cases/sync/string_cow.out b/ops/op2/test_cases/sync/string_cow.out deleted file mode 100644 index 7d388e598..000000000 --- a/ops/op2/test_cases/sync/string_cow.out +++ /dev/null @@ -1,75 +0,0 @@ -#[allow(non_camel_case_types)] -struct op_string_cow { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_string_cow { - const NAME: &'static str = stringify!(op_string_cow); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_string_cow), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::SeqOneByteString], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 1usize as u8, - }; -} -impl op_string_cow { - pub const fn name() -> &'static str { - stringify!(op_string_cow) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_string_cow), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::SeqOneByteString], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 1usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - arg0: *mut deno_core::v8::fast_api::FastApiOneByteString, - ) -> u32 { - let mut arg0_temp: [::std::mem::MaybeUninit<u8>; 1024] = [::std::mem::MaybeUninit::uninit(); 1024]; - let arg0 = deno_core::_ops::to_str_ptr(unsafe { &mut *arg0 }, &mut arg0_temp); - let result = Self::call(arg0); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let arg0 = args.get(0usize as i32); - let mut arg0_temp: [::std::mem::MaybeUninit<u8>; 1024] = [::std::mem::MaybeUninit::uninit(); 1024]; - let arg0 = deno_core::_ops::to_str(scope, &arg0, &mut arg0_temp); - let result = Self::call(arg0); - rv.set_uint32(result as u32); - } - #[inline(always)] - fn call(s: Cow<str>) -> u32 {} -} diff --git a/ops/op2/test_cases/sync/string_cow.rs b/ops/op2/test_cases/sync/string_cow.rs deleted file mode 100644 index ed4dfca82..000000000 --- a/ops/op2/test_cases/sync/string_cow.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -fn op_string_cow(#[string] s: Cow<str>) -> u32 {} diff --git a/ops/op2/test_cases/sync/string_option_return.out b/ops/op2/test_cases/sync/string_option_return.out deleted file mode 100644 index 6143ac217..000000000 --- a/ops/op2/test_cases/sync/string_option_return.out +++ /dev/null @@ -1,53 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_string_return { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_string_return { - const NAME: &'static str = stringify!(op_string_return); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_string_return), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: None, - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - }; -} -impl op_string_return { - pub const fn name() -> &'static str { - stringify!(op_string_return) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_string_return), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: None, - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - } - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let result = Self::call(); - if let Some(result) = result { - if result.is_empty() { - rv.set_empty_string(); - } else { - let temp = deno_core::v8::String::new(scope, &result).unwrap(); - rv.set(temp.into()); - } - } else { - rv.set_null(); - } - } - #[inline(always)] - pub fn call() -> Option<String> {} -} diff --git a/ops/op2/test_cases/sync/string_option_return.rs b/ops/op2/test_cases/sync/string_option_return.rs deleted file mode 100644 index 932836d2f..000000000 --- a/ops/op2/test_cases/sync/string_option_return.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2] -#[string] -pub fn op_string_return() -> Option<String> {} diff --git a/ops/op2/test_cases/sync/string_owned.out b/ops/op2/test_cases/sync/string_owned.out deleted file mode 100644 index 7418a311c..000000000 --- a/ops/op2/test_cases/sync/string_owned.out +++ /dev/null @@ -1,73 +0,0 @@ -#[allow(non_camel_case_types)] -struct op_string_owned { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_string_owned { - const NAME: &'static str = stringify!(op_string_owned); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_string_owned), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::SeqOneByteString], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 1usize as u8, - }; -} -impl op_string_owned { - pub const fn name() -> &'static str { - stringify!(op_string_owned) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_string_owned), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::SeqOneByteString], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 1usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - arg0: *mut deno_core::v8::fast_api::FastApiOneByteString, - ) -> u32 { - let arg0 = deno_core::_ops::to_string_ptr(unsafe { &mut *arg0 }); - let result = Self::call(arg0); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let arg0 = args.get(0usize as i32); - let arg0 = arg0.to_rust_string_lossy(scope); - let result = Self::call(arg0); - rv.set_uint32(result as u32); - } - #[inline(always)] - fn call(s: String) -> u32 {} -} diff --git a/ops/op2/test_cases/sync/string_owned.rs b/ops/op2/test_cases/sync/string_owned.rs deleted file mode 100644 index b81d7ece9..000000000 --- a/ops/op2/test_cases/sync/string_owned.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -fn op_string_owned(#[string] s: String) -> u32 {} diff --git a/ops/op2/test_cases/sync/string_ref.out b/ops/op2/test_cases/sync/string_ref.out deleted file mode 100644 index 1b853fccc..000000000 --- a/ops/op2/test_cases/sync/string_ref.out +++ /dev/null @@ -1,75 +0,0 @@ -#[allow(non_camel_case_types)] -struct op_string_owned { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_string_owned { - const NAME: &'static str = stringify!(op_string_owned); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_string_owned), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::SeqOneByteString], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 1usize as u8, - }; -} -impl op_string_owned { - pub const fn name() -> &'static str { - stringify!(op_string_owned) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_string_owned), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: Some({ - use deno_core::v8::fast_api::Type; - use deno_core::v8::fast_api::CType; - deno_core::v8::fast_api::FastFunction::new( - &[Type::V8Value, Type::SeqOneByteString], - CType::Uint32, - Self::v8_fn_ptr_fast as *const ::std::ffi::c_void, - ) - }), - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 1usize as u8, - } - } - fn v8_fn_ptr_fast( - _: deno_core::v8::Local<deno_core::v8::Object>, - arg0: *mut deno_core::v8::fast_api::FastApiOneByteString, - ) -> u32 { - let mut arg0_temp: [::std::mem::MaybeUninit<u8>; 1024] = [::std::mem::MaybeUninit::uninit(); 1024]; - let arg0 = &deno_core::_ops::to_str_ptr(unsafe { &mut *arg0 }, &mut arg0_temp); - let result = Self::call(arg0); - result - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info(unsafe { - &*info - }); - let arg0 = args.get(0usize as i32); - let mut arg0_temp: [::std::mem::MaybeUninit<u8>; 1024] = [::std::mem::MaybeUninit::uninit(); 1024]; - let arg0 = &deno_core::_ops::to_str(scope, &arg0, &mut arg0_temp); - let result = Self::call(arg0); - rv.set_uint32(result as u32); - } - #[inline(always)] - fn call(s: &str) -> u32 {} -} diff --git a/ops/op2/test_cases/sync/string_ref.rs b/ops/op2/test_cases/sync/string_ref.rs deleted file mode 100644 index a7efa9f0c..000000000 --- a/ops/op2/test_cases/sync/string_ref.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2(fast)] -fn op_string_owned(#[string] s: &str) -> u32 {} diff --git a/ops/op2/test_cases/sync/string_return.out b/ops/op2/test_cases/sync/string_return.out deleted file mode 100644 index 5e68b9314..000000000 --- a/ops/op2/test_cases/sync/string_return.out +++ /dev/null @@ -1,49 +0,0 @@ -#[allow(non_camel_case_types)] -pub struct op_string_return { - _unconstructable: ::std::marker::PhantomData<()>, -} -impl deno_core::_ops::Op for op_string_return { - const NAME: &'static str = stringify!(op_string_return); - const DECL: deno_core::_ops::OpDecl = deno_core::_ops::OpDecl { - name: stringify!(op_string_return), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: None, - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - }; -} -impl op_string_return { - pub const fn name() -> &'static str { - stringify!(op_string_return) - } - pub const fn decl() -> deno_core::_ops::OpDecl { - deno_core::_ops::OpDecl { - name: stringify!(op_string_return), - v8_fn_ptr: Self::v8_fn_ptr as _, - enabled: true, - fast_fn: None, - is_async: false, - is_unstable: false, - is_v8: false, - arg_count: 0usize as u8, - } - } - extern "C" fn v8_fn_ptr(info: *const deno_core::v8::FunctionCallbackInfo) { - let scope = &mut unsafe { deno_core::v8::CallbackScope::new(&*info) }; - let mut rv = deno_core::v8::ReturnValue::from_function_callback_info(unsafe { - &*info - }); - let result = Self::call(); - if result.is_empty() { - rv.set_empty_string(); - } else { - let temp = deno_core::v8::String::new(scope, &result).unwrap(); - rv.set(temp.into()); - } - } - #[inline(always)] - pub fn call() -> String {} -} diff --git a/ops/op2/test_cases/sync/string_return.rs b/ops/op2/test_cases/sync/string_return.rs deleted file mode 100644 index 667b68a14..000000000 --- a/ops/op2/test_cases/sync/string_return.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. - -#[op2] -#[string] -pub fn op_string_return() -> String {} |