From 41b24d59549faaec36d076a18546c9c323e93b5e Mon Sep 17 00:00:00 2001 From: Alistair Date: Fri, 27 Oct 2023 15:30:20 +0100 Subject: [PATCH] Remove panic converting `NoInstructonsRemaining` to `OpaqeError` --- boa_engine/src/context/mod.rs | 4 ++-- boa_engine/src/error.rs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/boa_engine/src/context/mod.rs b/boa_engine/src/context/mod.rs index 2a8a3df9c79..60eb6313abd 100644 --- a/boa_engine/src/context/mod.rs +++ b/boa_engine/src/context/mod.rs @@ -525,9 +525,9 @@ impl<'host> Context<'host> { } /// Get the remaining instruction count - #[cfg(freature = "fuzz")] + #[cfg(feature = "fuzz")] #[inline] - pub const fn instructions_remaining(&self) -> u64 { + pub const fn instructions_remaining(&self) -> usize { self.instructions_remaining } /// Get the [`RootShape`]. diff --git a/boa_engine/src/error.rs b/boa_engine/src/error.rs index 839f404c687..a103197d6b6 100644 --- a/boa_engine/src/error.rs +++ b/boa_engine/src/error.rs @@ -819,9 +819,7 @@ impl JsNativeError { JsNativeErrorKind::Uri => (constructors.uri_error().prototype(), ErrorKind::Uri), #[cfg(feature = "fuzz")] JsNativeErrorKind::NoInstructionsRemain => { - unreachable!( - "The NoInstructionsRemain native error cannot be converted to an opaque type." - ) + (constructors.eval_error().prototype(), ErrorKind::Eval) } JsNativeErrorKind::RuntimeLimit => { panic!("The RuntimeLimit native error cannot be converted to an opaque type.")