From 467b0d43e76a43874519d1309142708140d68bb4 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Mon, 6 Jan 2025 16:46:20 +0100 Subject: [PATCH] fix --- core/error.rs | 2 +- core/webidl.rs | 4 +++- ops/op2/dispatch_slow.rs | 2 +- testing/checkin/runner/ops.rs | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/error.rs b/core/error.rs index 261875f28..ecf00d3ed 100644 --- a/core/error.rs +++ b/core/error.rs @@ -1393,7 +1393,7 @@ pub mod callsite_fns { fn to_string_inner<'e>( scope: &mut v8::HandleScope<'e>, this: v8::Local<'e, v8::Object>, - orig: v8::Local<'e, Object>, + orig: v8::Local<'e, v8::Object>, orig_to_string_v8: v8::Local<'e, v8::String>, ) -> Option> { let orig_to_string = serde_v8::to_utf8(orig_to_string_v8, scope); diff --git a/core/webidl.rs b/core/webidl.rs index 5fe3cca2a..c6c028b0e 100644 --- a/core/webidl.rs +++ b/core/webidl.rs @@ -1,12 +1,14 @@ // Copyright 2018-2025 the Deno authors. MIT license. +use deno_error::JsError; use indexmap::IndexMap; use std::borrow::Cow; use v8::HandleScope; use v8::Local; use v8::Value; -#[derive(Debug)] +#[derive(Debug, JsError)] +#[class(type)] pub struct WebIdlError { pub prefix: Cow<'static, str>, pub context: Cow<'static, str>, diff --git a/ops/op2/dispatch_slow.rs b/ops/op2/dispatch_slow.rs index 9350159c7..c9d72a745 100644 --- a/ops/op2/dispatch_slow.rs +++ b/ops/op2/dispatch_slow.rs @@ -665,7 +665,7 @@ pub fn from_arg( syn::parse_str::(ty).expect("Failed to reparse state type"); let scope = scope.clone(); let err = format_ident!("{}_err", arg_ident); - let throw_exception = throw_type_error_string(generator_state, &err)?; + let throw_exception = throw_type_error_string(generator_state, &err); let prefix = get_prefix(generator_state); let context = format!("Argument {}", index + 1); diff --git a/testing/checkin/runner/ops.rs b/testing/checkin/runner/ops.rs index b2f23bc5f..7c8f31bd6 100644 --- a/testing/checkin/runner/ops.rs +++ b/testing/checkin/runner/ops.rs @@ -3,6 +3,7 @@ use std::cell::RefCell; use std::rc::Rc; +use deno_core::error::OpError; use deno_core::op2; use deno_core::stats::RuntimeActivityDiff; use deno_core::stats::RuntimeActivitySnapshot; @@ -97,7 +98,7 @@ impl TestObjectWrap { fn with_rename(&self) {} #[async_method] - async fn with_async_fn(&self, #[smi] ms: u32) -> Result<(), AnyError> { + async fn with_async_fn(&self, #[smi] ms: u32) -> Result<(), OpError> { tokio::time::sleep(std::time::Duration::from_millis(ms as u64)).await; Ok(()) }