From e5e2c45998d3a655c4b2d78c0a1fcb61e09c1982 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 8 Feb 2024 20:40:26 -0500 Subject: fix: upgrade to deno_ast 0.33 (#22341) * Uses diagnostics from deno_ast * Real fix for https://github.com/denoland/deno/pull/22310 * Moves `deno lint --json` code here * Upgrades swc Closes #22117 Closes #22109 Closes #21927 Closes #20993 --- cli/errors.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cli/errors.rs') diff --git a/cli/errors.rs b/cli/errors.rs index c2539df7e..fce286f15 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -9,7 +9,7 @@ //! Diagnostics are compile-time type errors, whereas JsErrors are runtime //! exceptions. -use deno_ast::Diagnostic; +use deno_ast::ParseDiagnostic; use deno_core::error::AnyError; use deno_graph::source::ResolveError; use deno_graph::ModuleError; @@ -22,7 +22,7 @@ fn get_import_map_error_class(_: &ImportMapError) -> &'static str { "URIError" } -fn get_diagnostic_class(_: &Diagnostic) -> &'static str { +fn get_diagnostic_class(_: &ParseDiagnostic) -> &'static str { "SyntaxError" } @@ -67,7 +67,10 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str { e.downcast_ref::() .map(get_import_map_error_class) }) - .or_else(|| e.downcast_ref::().map(get_diagnostic_class)) + .or_else(|| { + e.downcast_ref::() + .map(get_diagnostic_class) + }) .or_else(|| { e.downcast_ref::() .map(get_module_graph_error_class) -- cgit v1.2.3