Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -533,3 +533,6 @@ opt-level = 3
opt-level = 3
[profile.release.package.deno_npm_cache]
opt-level = 3

[patch.crates-io]
deno_core = { path = "../deno_core/core" }
2 changes: 1 addition & 1 deletion cli/lib/util/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<T> InfallibleResultExt<T> for Result<T, Infallible> {

pub fn js_error_downcast_ref(
err: &AnyError,
) -> Option<&deno_runtime::deno_core::error::JsError> {
) -> Option<&Box<deno_runtime::deno_core::error::JsError>> {
any_and_jserrorbox_downcast_ref(err).or_else(|| {
err
.downcast_ref::<CoreError>()
Expand Down
17 changes: 7 additions & 10 deletions cli/lib/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,32 +816,29 @@ impl LibMainWorker {
}

#[inline]
#[allow(clippy::result_large_err)]
pub fn dispatch_load_event(&mut self) -> Result<(), JsError> {
pub fn dispatch_load_event(&mut self) -> Result<(), Box<JsError>> {
self.worker.dispatch_load_event()
}

#[inline]
#[allow(clippy::result_large_err)]
pub fn dispatch_beforeunload_event(&mut self) -> Result<bool, JsError> {
pub fn dispatch_beforeunload_event(&mut self) -> Result<bool, Box<JsError>> {
self.worker.dispatch_beforeunload_event()
}

#[inline]
#[allow(clippy::result_large_err)]
pub fn dispatch_process_beforeexit_event(&mut self) -> Result<bool, JsError> {
pub fn dispatch_process_beforeexit_event(
&mut self,
) -> Result<bool, Box<JsError>> {
self.worker.dispatch_process_beforeexit_event()
}

#[inline]
#[allow(clippy::result_large_err)]
pub fn dispatch_unload_event(&mut self) -> Result<(), JsError> {
pub fn dispatch_unload_event(&mut self) -> Result<(), Box<JsError>> {
self.worker.dispatch_unload_event()
}

#[inline]
#[allow(clippy::result_large_err)]
pub fn dispatch_process_exit_event(&mut self) -> Result<(), JsError> {
pub fn dispatch_process_exit_event(&mut self) -> Result<(), Box<JsError>> {
self.worker.dispatch_process_exit_event()
}

Expand Down
5 changes: 1 addition & 4 deletions cli/tools/bench/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ async fn bench_specifier(
Ok(()) => Ok(()),
Err(CreateCustomWorkerError::Core(error)) => match error.into_kind() {
CoreErrorKind::Js(error) => {
sender.send(BenchEvent::UncaughtError(
specifier.to_string(),
Box::new(error),
))?;
sender.send(BenchEvent::UncaughtError(specifier.to_string(), error))?;
Ok(())
}
error => Err(error.into_box().into()),
Expand Down
6 changes: 3 additions & 3 deletions cli/tools/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ async fn configure_main_worker(
Ok(()) => Ok(()),
Err(CoreErrorKind::Js(err)) => send_test_event(
&op_state,
TestEvent::UncaughtError(specifier.to_string(), Box::new(err)),
TestEvent::UncaughtError(specifier.to_string(), err),
)
.map_err(|e| CoreErrorKind::JsBox(JsErrorBox::from_err(e)).into_box()),
Err(err) => Err(err.into_box()),
Expand Down Expand Up @@ -742,7 +742,7 @@ pub async fn test_specifier(
CoreErrorKind::Js(err) => {
send_test_event(
&worker.js_runtime.op_state(),
TestEvent::UncaughtError(specifier.to_string(), Box::new(err)),
TestEvent::UncaughtError(specifier.to_string(), err),
)?;
Ok(())
}
Expand Down Expand Up @@ -1059,7 +1059,7 @@ async fn run_tests_for_worker_inner(
CoreErrorKind::Js(js_error) => {
send_test_event(
&state_rc,
TestEvent::UncaughtError(specifier.to_string(), Box::new(js_error)),
TestEvent::UncaughtError(specifier.to_string(), js_error),
)?;
fail_fast_tracker.add_failure();
send_test_event(
Expand Down
3 changes: 1 addition & 2 deletions cli/tsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1296,15 +1296,14 @@ fn op_respond_inner(state: &mut OpState, args: RespondArgs) {
state.maybe_response = Some(args);
}

#[allow(clippy::large_enum_variant)]
#[derive(Debug, Error, deno_error::JsError)]
pub enum ExecError {
#[class(generic)]
#[error("The response for the exec request was not set.")]
ResponseNotSet,
#[class(inherit)]
#[error(transparent)]
Js(deno_core::error::JsError),
Js(Box<deno_core::error::JsError>),
}

#[derive(Clone)]
Expand Down
3 changes: 1 addition & 2 deletions cli/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,11 @@ impl CliMainWorker {
Ok(Some(coverage_collector))
}

#[allow(clippy::result_large_err)]
pub fn execute_script_static(
&mut self,
name: &'static str,
source_code: &'static str,
) -> Result<v8::Global<v8::Value>, JsError> {
) -> Result<v8::Global<v8::Value>, Box<JsError>> {
self.worker.js_runtime().execute_script(name, source_code)
}
}
Expand Down
Loading