From 2fcf1f14cf29bb68995f652f93a4f6e3cb55c8d7 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 21 Mar 2023 11:46:40 -0400 Subject: feat: TypeScript 5.0.2 (except decorators) (#18294) This upgrades TypeScript to 5.0.2, but does not have ES decorator support because swc does not support that yet. --- cli/errors.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'cli/errors.rs') diff --git a/cli/errors.rs b/cli/errors.rs index 3ec17e8b2..2ffad73b3 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -11,6 +11,7 @@ use deno_ast::Diagnostic; use deno_core::error::AnyError; +use deno_graph::ModuleError; use deno_graph::ModuleGraphError; use deno_graph::ResolutionError; use import_map::ImportMapError; @@ -25,18 +26,17 @@ fn get_diagnostic_class(_: &Diagnostic) -> &'static str { fn get_module_graph_error_class(err: &ModuleGraphError) -> &'static str { match err { - ModuleGraphError::LoadingErr(_, _, err) => { - get_error_class_name(err.as_ref()) - } - ModuleGraphError::InvalidTypeAssertion { .. } => "SyntaxError", - ModuleGraphError::ParseErr(_, diagnostic) => { - get_diagnostic_class(diagnostic) - } + ModuleGraphError::ModuleError(err) => match err { + ModuleError::LoadingErr(_, _, err) => get_error_class_name(err.as_ref()), + ModuleError::InvalidTypeAssertion { .. } => "SyntaxError", + ModuleError::ParseErr(_, diagnostic) => get_diagnostic_class(diagnostic), + ModuleError::UnsupportedMediaType { .. } + | ModuleError::UnsupportedImportAssertionType { .. } => "TypeError", + ModuleError::Missing(_, _) | ModuleError::MissingDynamic(_, _) => { + "NotFound" + } + }, ModuleGraphError::ResolutionError(err) => get_resolution_error_class(err), - ModuleGraphError::UnsupportedMediaType { .. } - | ModuleGraphError::UnsupportedImportAssertionType { .. } => "TypeError", - ModuleGraphError::Missing(_, _) - | ModuleGraphError::MissingDynamic(_, _) => "NotFound", } } -- cgit v1.2.3