diff options
Diffstat (limited to 'ops/optimizer_tests/strings.out')
-rw-r--r-- | ops/optimizer_tests/strings.out | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ops/optimizer_tests/strings.out b/ops/optimizer_tests/strings.out index 8a72c8cab..3238bfc42 100644 --- a/ops/optimizer_tests/strings.out +++ b/ops/optimizer_tests/strings.out @@ -31,7 +31,7 @@ impl op_string_length { use deno_core::v8::fast_api::CType; Some( deno_core::v8::fast_api::FastFunction::new( - &[V8Value, SeqOneByteString], + &[V8Value, SeqOneByteString, CallbackOptions], CType::Uint32, op_string_length_fast_fn as *const ::std::ffi::c_void, ), @@ -90,10 +90,17 @@ impl op_string_length { fn op_string_length_fast_fn<'scope>( _: deno_core::v8::Local<deno_core::v8::Object>, string: *const deno_core::v8::fast_api::FastApiOneByteString, + fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions, ) -> u32 { use deno_core::v8; use deno_core::_ops; - let string = unsafe { &*string }.as_str(); + let string = match ::std::str::from_utf8(unsafe { &*string }.as_bytes()) { + Ok(v) => v, + Err(_) => { + unsafe { &mut *fast_api_callback_options }.fallback = true; + return Default::default(); + } + }; let result = op_string_length::call(string); result } |