diff --git a/crates/oxc_cfg/src/dot.rs b/crates/oxc_cfg/src/dot.rs index bb71eae682f4e..07847d2d41d98 100644 --- a/crates/oxc_cfg/src/dot.rs +++ b/crates/oxc_cfg/src/dot.rs @@ -1,11 +1,11 @@ -// use oxc_ast::{ -// ast::{BreakStatement, ContinueStatement}, -// AstKind, -// }; +use std::{borrow::Cow, fmt}; + +use itertools::Itertools as _; use petgraph::{ dot::{Config, Dot}, visit::EdgeRef, }; +use rustc_hash::FxHashMap; use super::IterationInstructionKind; use crate::{ @@ -26,19 +26,31 @@ impl DisplayDot for ControlFlowGraph { &[Config::EdgeNoLabel, Config::NodeNoLabel], &|_graph, edge| { let weight = edge.weight(); - let label = format!("label = \"{weight:?}\" "); + let mut attrs = Attrs::default().with("label", format!("{weight:?}")); + if matches!(weight, EdgeType::Unreachable) || self.basic_block(edge.source()).unreachable { - format!("{label}, style = \"dotted\" ") - } else { - label + attrs += ("style", "dotted"); + } else if matches!(weight, EdgeType::Error(_)) { + attrs += ("color", "red"); + }; + + format!("{attrs:?}") + }, + &|_graph, node| { + let block = &self.basic_blocks[*node.1]; + let mut attrs = Attrs::default().with("label", block.display_dot()); + + if *node.1 == 0 { + attrs += ("color", "green"); + } + if block.unreachable { + attrs += ("style", "dotted"); } + + format!("{attrs:?}") }, - &|_graph, node| format!( - "label = {:?} ", - self.basic_blocks[*node.1].display_dot().trim() - ), ) ) } @@ -46,11 +58,7 @@ impl DisplayDot for ControlFlowGraph { impl DisplayDot for BasicBlock { fn display_dot(&self) -> String { - self.instructions().iter().fold(String::new(), |mut acc, it| { - acc.push_str(it.display_dot().as_str()); - acc.push('\n'); - acc - }) + self.instructions().iter().map(DisplayDot::display_dot).join("\n") } } @@ -77,3 +85,101 @@ impl DisplayDot for Instruction { .to_string() } } + +#[derive(Clone)] +pub enum Attr<'a> { + String(Cow<'a, str>), + Identifier(Cow<'a, str>), + Int(i64), +} +impl<'a> Attr<'a> { + #[inline] + #[must_use] + pub fn ident(identifier: S) -> Self + where + S: Into>, + { + Self::Identifier(identifier.into()) + } +} + +impl fmt::Debug for Attr<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Int(i) => write!(f, "{i}"), + Self::String(s) => write!(f, "{s:?}"), + Self::Identifier(ident) => write!(f, "{ident}"), // display instead of debug + } + } +} + +impl<'a> From<&'a str> for Attr<'a> { + fn from(value: &'a str) -> Self { + Self::String(Cow::Borrowed(value)) + } +} + +impl From for Attr<'static> { + fn from(value: String) -> Self { + Self::String(Cow::Owned(value)) + } +} + +impl From for Attr<'_> { + fn from(value: i64) -> Self { + Self::Int(value) + } +} + +#[derive(Default)] +pub struct Attrs<'a>(FxHashMap, Attr<'a>>); +impl<'a> Attrs<'a> { + #[must_use] + #[inline] + pub fn with(mut self, key: K, value: V) -> Self + where + K: Into>, + V: Into>, + { + self += (key, value); + self + } +} + +impl<'a, K, V> FromIterator<(K, V)> for Attrs<'a> +where + K: Into>, + V: Into>, +{ + fn from_iter>(iter: T) -> Self { + Self(iter.into_iter().map(|(k, v)| (k.into(), v.into())).collect()) + } +} + +impl<'a, K, V> std::ops::AddAssign<(K, V)> for Attrs<'a> +where + K: Into>, + V: Into>, +{ + fn add_assign(&mut self, (key, value): (K, V)) { + self.0.insert(key.into(), value.into()); + } +} + +impl fmt::Debug for Attrs<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.0.is_empty() { + return Ok(()); + } + + let l = self.0.len(); + for (i, (k, v)) in self.0.iter().enumerate() { + write!(f, "{k}={v:?}")?; + if i < l - 1 { + write!(f, ", ")?; + } + } + + Ok(()) + } +} diff --git a/crates/oxc_cfg/src/lib.rs b/crates/oxc_cfg/src/lib.rs index 2e126aa444e55..892366b1200c7 100644 --- a/crates/oxc_cfg/src/lib.rs +++ b/crates/oxc_cfg/src/lib.rs @@ -1,5 +1,5 @@ mod builder; -mod dot; +pub mod dot; pub mod visit; use itertools::Itertools; diff --git a/crates/oxc_semantic/src/dot.rs b/crates/oxc_semantic/src/dot.rs index d97ad8dacf0f0..f4ab8fdeaf567 100644 --- a/crates/oxc_semantic/src/dot.rs +++ b/crates/oxc_semantic/src/dot.rs @@ -3,6 +3,7 @@ use oxc_ast::{ AstKind, }; use oxc_cfg::{ + dot::{Attr, Attrs}, graph::{ dot::{Config, Dot}, visit::EdgeRef, @@ -69,14 +70,30 @@ impl DebugDot for ControlFlowGraph { if !ctx.verbose && matches!(weight, EdgeType::Error(ErrorEdgeKind::Implicit)) { return String::new(); } - let label = format!("label = \"{weight:?}\" "); + let mut attrs = Attrs::from_iter([("label", format!("{weight:?}"))]); if matches!(weight, EdgeType::Unreachable) || self.basic_block(edge.source()).unreachable { - format!("{label}, style = \"dotted\" ") - } else { - label + attrs += ("style", "dotted"); + } + + match weight { + EdgeType::Error(kind) => { + attrs += ("color", Attr::ident("red")); + if matches!(kind, ErrorEdgeKind::Implicit) { + attrs += ("style", Attr::ident("dashed")); + } + } + EdgeType::Backedge => { + attrs += ("color", Attr::ident("grey")); + } + EdgeType::Jump => { + attrs += ("color", Attr::ident("green")); + } + _ => {} } + + format!("{attrs:?}") }, &|_graph, node| { let basic_block_index = *node.1; diff --git a/crates/oxc_semantic/tests/integration/snapshots/argument_map.snap b/crates/oxc_semantic/tests/integration/snapshots/argument_map.snap index 8210b0493d9c5..d7f6ad1f0a610 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/argument_map.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/argument_map.snap @@ -30,9 +30,9 @@ digraph { 3 [ label = "bb3 ExpressionStatement" shape = box] 4 [ label = "bb4" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 1 -> 4 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 4 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/arrow_expressions.snap b/crates/oxc_semantic/tests/integration/snapshots/arrow_expressions.snap index 931b1a3b1991d..2f6c0f0485904 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/arrow_expressions.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/arrow_expressions.snap @@ -39,9 +39,9 @@ ExpressionStatement" shape = box] 4 [ label = "bb4" shape = box] 5 [ label = "bb5 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 5 -> 4 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "NewFunction" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 5 -> 4 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="NewFunction"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/assignment_operators.snap b/crates/oxc_semantic/tests/integration/snapshots/assignment_operators.snap index 8d8b8f10db2aa..14fd55c7e1fba 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/assignment_operators.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/assignment_operators.snap @@ -50,20 +50,20 @@ ExpressionStatement" shape = box] 7 [ label = "bb7 ExpressionStatement ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 2 -> 0 [ label = "Error(Implicit)" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 1 -> 2 [ label = "Normal" ] - 1 -> 3 [ label = "Normal" ] - 2 -> 3 [ label = "Normal" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 3 -> 4 [ label = "Normal" ] - 3 -> 5 [ label = "Normal" ] - 4 -> 5 [ label = "Normal" ] - 6 -> 0 [ label = "Error(Implicit)" ] - 7 -> 0 [ label = "Error(Implicit)" ] - 5 -> 6 [ label = "Normal" ] - 5 -> 7 [ label = "Normal" ] - 6 -> 7 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 2 [ label="Normal"] + 1 -> 3 [ label="Normal"] + 2 -> 3 [ label="Normal"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Normal"] + 3 -> 5 [ label="Normal"] + 4 -> 5 [ label="Normal"] + 6 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 6 [ label="Normal"] + 5 -> 7 [ label="Normal"] + 6 -> 7 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/break_from_a_label_in_global_scope.snap b/crates/oxc_semantic/tests/integration/snapshots/break_from_a_label_in_global_scope.snap index a604a3391158a..a3408724ea395 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/break_from_a_label_in_global_scope.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/break_from_a_label_in_global_scope.snap @@ -28,10 +28,10 @@ break " shape = box] 2 [ label = "bb2 unreachable" shape = box] 3 [ label = "bb3" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 2 -> 0 [ label = "Error(Implicit)" , style = "dotted" ] - 1 -> 2 [ label = "Unreachable" , style = "dotted" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 2 -> 3 [ label = "Normal" , style = "dotted" ] - 1 -> 3 [ label = "Jump" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 2 [ label="Unreachable", style="dotted"] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 3 [ label="Normal", style="dotted"] + 1 -> 3 [ label="Jump", color=green] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/class.snap b/crates/oxc_semantic/tests/integration/snapshots/class.snap index aa661869b1d8f..a814c6bae08b5 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/class.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/class.snap @@ -30,9 +30,9 @@ digraph { 3 [ label = "bb3 ExpressionStatement" shape = box] 4 [ label = "bb4" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 1 -> 4 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 4 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/class_extend_super.snap b/crates/oxc_semantic/tests/integration/snapshots/class_extend_super.snap index 7c13554c45daf..7d11e659da7aa 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/class_extend_super.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/class_extend_super.snap @@ -36,11 +36,11 @@ return " shape = box] 4 [ label = "bb4 unreachable" shape = box] 5 [ label = "bb5" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/cond_expr_in_arrow_fn.snap b/crates/oxc_semantic/tests/integration/snapshots/cond_expr_in_arrow_fn.snap index 496b0a5f831d3..6e76a22dc143b 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/cond_expr_in_arrow_fn.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/cond_expr_in_arrow_fn.snap @@ -47,16 +47,16 @@ Condition(CallExpression(a))" shape = box] 5 [ label = "bb5" shape = box] 6 [ label = "bb6" shape = box] 7 [ label = "bb7" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 6 -> 2 [ label = "Error(Implicit)" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 3 -> 4 [ label = "Normal" ] - 5 -> 7 [ label = "Normal" ] - 4 -> 5 [ label = "Jump" ] - 4 -> 6 [ label = "Normal" ] - 6 -> 7 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Normal"] + 5 -> 7 [ label="Normal"] + 4 -> 5 [ label="Jump", color=green] + 4 -> 6 [ label="Normal"] + 6 -> 7 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/conditional_expression.snap b/crates/oxc_semantic/tests/integration/snapshots/conditional_expression.snap index 3a66031d3eae6..d45415ab5286c 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/conditional_expression.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/conditional_expression.snap @@ -37,14 +37,14 @@ Condition(CallExpression(a))" shape = box] 4 [ label = "bb4" shape = box] 5 [ label = "bb5 VariableDeclaration" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 2 -> 0 [ label = "Error(Implicit)" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 2 [ label = "Normal" ] - 3 -> 5 [ label = "Normal" ] - 2 -> 3 [ label = "Jump" ] - 2 -> 4 [ label = "Normal" ] - 4 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 2 [ label="Normal"] + 3 -> 5 [ label="Normal"] + 2 -> 3 [ label="Jump", color=green] + 2 -> 4 [ label="Normal"] + 4 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/do_while_break.snap b/crates/oxc_semantic/tests/integration/snapshots/do_while_break.snap index 1df3a3772f610..2384774cbb8f2 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/do_while_break.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/do_while_break.snap @@ -78,26 +78,26 @@ Condition(true)" shape = box] 10 [ label = "bb10" shape = box] 11 [ label = "bb11" shape = box] 12 [ label = "bb12" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 5 -> 4 [ label = "Finalize" ] - 6 -> 2 [ label = "Error(Implicit)" ] - 4 -> 6 [ label = "Normal" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 8 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 7 -> 8 [ label = "Unreachable" , style = "dotted" ] - 9 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 10 -> 2 [ label = "Error(Implicit)" ] - 6 -> 7 [ label = "Normal" ] - 8 -> 9 [ label = "Normal" , style = "dotted" ] - 9 -> 10 [ label = "Normal" , style = "dotted" ] - 9 -> 7 [ label = "Backedge" , style = "dotted" ] - 7 -> 10 [ label = "Jump" ] - 11 -> 2 [ label = "Error(Implicit)" ] - 3 -> 5 [ label = "Normal" ] - 10 -> 11 [ label = "Join" ] - 12 -> 0 [ label = "Error(Implicit)" ] - 1 -> 12 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 4 [ label="Finalize"] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 6 [ label="Normal"] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Unreachable", style="dotted"] + 9 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 7 [ label="Normal"] + 8 -> 9 [ label="Normal", style="dotted"] + 9 -> 10 [ label="Normal", style="dotted"] + 9 -> 7 [ label="Backedge", style="dotted", color=grey] + 7 -> 10 [ label="Jump", color=green] + 11 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 5 [ label="Normal"] + 10 -> 11 [ label="Join"] + 12 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 12 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/expression_spread.snap b/crates/oxc_semantic/tests/integration/snapshots/expression_spread.snap index c0d0e9ba18110..8385a1370780b 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/expression_spread.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/expression_spread.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 VariableDeclaration" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/fn_return_obj_expr_with_computed_key.snap b/crates/oxc_semantic/tests/integration/snapshots/fn_return_obj_expr_with_computed_key.snap index 84aed787a5b94..1fcc71b344c95 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/fn_return_obj_expr_with_computed_key.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/fn_return_obj_expr_with_computed_key.snap @@ -36,11 +36,11 @@ return " shape = box] 4 [ label = "bb4 unreachable" shape = box] 5 [ label = "bb5" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/for_in.snap b/crates/oxc_semantic/tests/integration/snapshots/for_in.snap index 727e7cf993487..8deef695b0b79 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/for_in.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/for_in.snap @@ -55,18 +55,18 @@ ExpressionStatement" shape = box] 7 [ label = "bb7 ExpressionStatement" shape = box] 8 [ label = "bb8" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 6 -> 2 [ label = "Error(Implicit)" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 3 -> 4 [ label = "Normal" ] - 4 -> 6 [ label = "Jump" ] - 6 -> 5 [ label = "Backedge" ] - 5 -> 4 [ label = "Backedge" ] - 4 -> 7 [ label = "Normal" ] - 8 -> 0 [ label = "Error(Implicit)" ] - 1 -> 8 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Normal"] + 4 -> 6 [ label="Jump", color=green] + 6 -> 5 [ label="Backedge", color=grey] + 5 -> 4 [ label="Backedge", color=grey] + 4 -> 7 [ label="Normal"] + 8 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 8 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/function_as_expression.snap b/crates/oxc_semantic/tests/integration/snapshots/function_as_expression.snap index d875f8a932243..fd18d78cfd187 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/function_as_expression.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/function_as_expression.snap @@ -209,59 +209,59 @@ ExpressionStatement" shape = box] 36 [ label = "bb36" shape = box] 37 [ label = "bb37" shape = box] 38 [ label = "bb38" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 1 -> 4 [ label = "Normal" ] - 6 -> 5 [ label = "Error(Implicit)" ] - 4 -> 6 [ label = "NewFunction" ] - 7 -> 0 [ label = "Error(Implicit)" ] - 4 -> 7 [ label = "Normal" ] - 9 -> 8 [ label = "Error(Implicit)" ] - 7 -> 9 [ label = "NewFunction" ] - 10 -> 0 [ label = "Error(Implicit)" ] - 7 -> 10 [ label = "Normal" ] - 12 -> 11 [ label = "Error(Implicit)" ] - 10 -> 12 [ label = "NewFunction" ] - 13 -> 0 [ label = "Error(Implicit)" ] - 10 -> 13 [ label = "Normal" ] - 15 -> 14 [ label = "Error(Implicit)" ] - 13 -> 15 [ label = "NewFunction" ] - 16 -> 0 [ label = "Error(Implicit)" ] - 13 -> 16 [ label = "Normal" ] - 18 -> 17 [ label = "Error(Implicit)" ] - 16 -> 18 [ label = "NewFunction" ] - 19 -> 0 [ label = "Error(Implicit)" ] - 16 -> 19 [ label = "Normal" ] - 21 -> 20 [ label = "Error(Implicit)" ] - 19 -> 21 [ label = "NewFunction" ] - 22 -> 0 [ label = "Error(Implicit)" ] - 19 -> 22 [ label = "Normal" ] - 24 -> 23 [ label = "Error(Implicit)" ] - 22 -> 24 [ label = "NewFunction" ] - 25 -> 0 [ label = "Error(Implicit)" ] - 22 -> 25 [ label = "Normal" ] - 26 -> 0 [ label = "Error(Implicit)" ] - 27 -> 0 [ label = "Error(Implicit)" ] - 25 -> 26 [ label = "Normal" ] - 25 -> 27 [ label = "Normal" ] - 26 -> 27 [ label = "Normal" ] - 29 -> 28 [ label = "Error(Implicit)" ] - 27 -> 29 [ label = "NewFunction" ] - 30 -> 0 [ label = "Error(Implicit)" ] - 27 -> 30 [ label = "Normal" ] - 31 -> 0 [ label = "Error(Implicit)" ] - 32 -> 0 [ label = "Error(Implicit)" ] - 30 -> 31 [ label = "Normal" ] - 30 -> 32 [ label = "Normal" ] - 31 -> 32 [ label = "Normal" ] - 34 -> 33 [ label = "Error(Implicit)" ] - 32 -> 34 [ label = "NewFunction" ] - 35 -> 0 [ label = "Error(Implicit)" ] - 32 -> 35 [ label = "Normal" ] - 37 -> 36 [ label = "Error(Implicit)" ] - 35 -> 37 [ label = "NewFunction" ] - 38 -> 0 [ label = "Error(Implicit)" ] - 35 -> 38 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 4 [ label="Normal"] + 6 -> 5 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 6 [ label="NewFunction"] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 7 [ label="Normal"] + 9 -> 8 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 9 [ label="NewFunction"] + 10 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 10 [ label="Normal"] + 12 -> 11 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 12 [ label="NewFunction"] + 13 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 13 [ label="Normal"] + 15 -> 14 [ label="Error(Implicit)", style=dashed, color=red] + 13 -> 15 [ label="NewFunction"] + 16 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 13 -> 16 [ label="Normal"] + 18 -> 17 [ label="Error(Implicit)", style=dashed, color=red] + 16 -> 18 [ label="NewFunction"] + 19 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 16 -> 19 [ label="Normal"] + 21 -> 20 [ label="Error(Implicit)", style=dashed, color=red] + 19 -> 21 [ label="NewFunction"] + 22 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 19 -> 22 [ label="Normal"] + 24 -> 23 [ label="Error(Implicit)", style=dashed, color=red] + 22 -> 24 [ label="NewFunction"] + 25 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 22 -> 25 [ label="Normal"] + 26 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 27 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 25 -> 26 [ label="Normal"] + 25 -> 27 [ label="Normal"] + 26 -> 27 [ label="Normal"] + 29 -> 28 [ label="Error(Implicit)", style=dashed, color=red] + 27 -> 29 [ label="NewFunction"] + 30 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 27 -> 30 [ label="Normal"] + 31 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 32 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 30 -> 31 [ label="Normal"] + 30 -> 32 [ label="Normal"] + 31 -> 32 [ label="Normal"] + 34 -> 33 [ label="Error(Implicit)", style=dashed, color=red] + 32 -> 34 [ label="NewFunction"] + 35 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 32 -> 35 [ label="Normal"] + 37 -> 36 [ label="Error(Implicit)", style=dashed, color=red] + 35 -> 37 [ label="NewFunction"] + 38 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 35 -> 38 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/function_in_finally.snap b/crates/oxc_semantic/tests/integration/snapshots/function_in_finally.snap index d0a61a8d42c09..5a5f089e816a6 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/function_in_finally.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/function_in_finally.snap @@ -54,16 +54,16 @@ ExpressionStatement" shape = box] 7 [ label = "bb7 ExpressionStatement" shape = box] 8 [ label = "bb8" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Finalize" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 2 -> 4 [ label = "Normal" ] - 6 -> 5 [ label = "Error(Implicit)" ] - 4 -> 6 [ label = "NewFunction" ] - 7 -> 0 [ label = "Error(Implicit)" ] - 4 -> 7 [ label = "Normal" ] - 8 -> 0 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "Normal" ] - 7 -> 8 [ label = "Join" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Finalize"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 4 [ label="Normal"] + 6 -> 5 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 6 [ label="NewFunction"] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 7 [ label="Normal"] + 8 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="Normal"] + 7 -> 8 [ label="Join"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/if_else.snap b/crates/oxc_semantic/tests/integration/snapshots/if_else.snap index ebf78c52b3215..16baf6d13ab7d 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/if_else.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/if_else.snap @@ -86,29 +86,29 @@ return " shape = box] 12 [ label = "bb12 unreachable" shape = box] 13 [ label = "bb13" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 6 -> 2 [ label = "Error(Implicit)" ] - 4 -> 5 [ label = "Normal" ] - 4 -> 6 [ label = "Normal" ] - 5 -> 6 [ label = "Normal" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 8 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 7 -> 8 [ label = "Unreachable" , style = "dotted" ] - 9 -> 2 [ label = "Error(Implicit)" ] - 10 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 9 -> 10 [ label = "Unreachable" , style = "dotted" ] - 11 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Normal" ] - 8 -> 11 [ label = "Normal" , style = "dotted" ] - 6 -> 7 [ label = "Jump" ] - 3 -> 9 [ label = "Normal" ] - 10 -> 11 [ label = "Normal" , style = "dotted" ] - 12 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 11 -> 12 [ label = "Unreachable" , style = "dotted" ] - 13 -> 0 [ label = "Error(Implicit)" ] - 1 -> 13 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Normal"] + 4 -> 6 [ label="Normal"] + 5 -> 6 [ label="Normal"] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Unreachable", style="dotted"] + 9 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 9 -> 10 [ label="Unreachable", style="dotted"] + 11 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Normal"] + 8 -> 11 [ label="Normal", style="dotted"] + 6 -> 7 [ label="Jump", color=green] + 3 -> 9 [ label="Normal"] + 10 -> 11 [ label="Normal", style="dotted"] + 12 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 11 -> 12 [ label="Unreachable", style="dotted"] + 13 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 13 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/if_stmt_in_for_in.snap b/crates/oxc_semantic/tests/integration/snapshots/if_stmt_in_for_in.snap index f09d2e482c30d..cc9f28f5d4ad3 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/if_stmt_in_for_in.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/if_stmt_in_for_in.snap @@ -120,40 +120,40 @@ ExpressionStatement" shape = box] 16 [ label = "bb16 ExpressionStatement" shape = box] 17 [ label = "bb17" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 6 -> 2 [ label = "Error(Implicit)" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 8 -> 2 [ label = "Error(Implicit)" ] - 9 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 8 -> 9 [ label = "Unreachable" , style = "dotted" ] - 10 -> 2 [ label = "Error(Implicit)" ] - 11 -> 2 [ label = "Error(Implicit)" ] - 12 -> 2 [ label = "Error(Implicit)" ] - 13 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 12 -> 13 [ label = "Unreachable" , style = "dotted" ] - 14 -> 2 [ label = "Error(Implicit)" ] - 10 -> 11 [ label = "Normal" ] - 13 -> 14 [ label = "Normal" , style = "dotted" ] - 11 -> 12 [ label = "Jump" ] - 10 -> 14 [ label = "Normal" ] - 15 -> 2 [ label = "Error(Implicit)" ] - 6 -> 7 [ label = "Normal" ] - 9 -> 15 [ label = "Normal" , style = "dotted" ] - 7 -> 8 [ label = "Jump" ] - 6 -> 10 [ label = "Normal" ] - 14 -> 15 [ label = "Normal" ] - 16 -> 2 [ label = "Error(Implicit)" ] - 3 -> 4 [ label = "Normal" ] - 4 -> 5 [ label = "Normal" ] - 5 -> 6 [ label = "Jump" ] - 15 -> 5 [ label = "Backedge" ] - 5 -> 16 [ label = "Normal" ] - 8 -> 16 [ label = "Jump" ] - 12 -> 5 [ label = "Jump" ] - 17 -> 0 [ label = "Error(Implicit)" ] - 1 -> 17 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 9 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 9 [ label="Unreachable", style="dotted"] + 10 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 11 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 12 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 13 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 12 -> 13 [ label="Unreachable", style="dotted"] + 14 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 11 [ label="Normal"] + 13 -> 14 [ label="Normal", style="dotted"] + 11 -> 12 [ label="Jump", color=green] + 10 -> 14 [ label="Normal"] + 15 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 7 [ label="Normal"] + 9 -> 15 [ label="Normal", style="dotted"] + 7 -> 8 [ label="Jump", color=green] + 6 -> 10 [ label="Normal"] + 14 -> 15 [ label="Normal"] + 16 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Normal"] + 4 -> 5 [ label="Normal"] + 5 -> 6 [ label="Jump", color=green] + 15 -> 5 [ label="Backedge", color=grey] + 5 -> 16 [ label="Normal"] + 8 -> 16 [ label="Jump", color=green] + 12 -> 5 [ label="Jump", color=green] + 17 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 17 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/import_as_function.snap b/crates/oxc_semantic/tests/integration/snapshots/import_as_function.snap index ba325c462ee26..f6f89ad26263d 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/import_as_function.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/import_as_function.snap @@ -26,7 +26,7 @@ ExpressionStatement" shape = box] 2 [ label = "bb2" shape = box] 3 [ label = "bb3 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/index_into_object_with_symbol_as_arg.snap b/crates/oxc_semantic/tests/integration/snapshots/index_into_object_with_symbol_as_arg.snap index 07b6dc5b88b5e..4b1f16adc146b 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/index_into_object_with_symbol_as_arg.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/index_into_object_with_symbol_as_arg.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/indexing_into_class_expression.snap b/crates/oxc_semantic/tests/integration/snapshots/indexing_into_class_expression.snap index 72caaf33324a6..7379398fc07b8 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/indexing_into_class_expression.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/indexing_into_class_expression.snap @@ -17,5 +17,5 @@ digraph { 1 [ label = "bb1 ExpressionStatement ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/infix_operators.snap b/crates/oxc_semantic/tests/integration/snapshots/infix_operators.snap index 9ac3f416171ba..c5f181b25d522 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/infix_operators.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/infix_operators.snap @@ -27,10 +27,10 @@ ExpressionStatement ExpressionStatement" shape = box] 2 [ label = "bb2" shape = box] 3 [ label = "bb3" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 2 -> 0 [ label = "Error(Implicit)" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 1 -> 2 [ label = "Normal" ] - 1 -> 3 [ label = "Normal" ] - 2 -> 3 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 2 [ label="Normal"] + 1 -> 3 [ label="Normal"] + 2 -> 3 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/labeled_block_break.snap b/crates/oxc_semantic/tests/integration/snapshots/labeled_block_break.snap index 971843622431b..e3b905c942219 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/labeled_block_break.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/labeled_block_break.snap @@ -73,24 +73,24 @@ unreachable" shape = box] 8 [ label = "bb8" shape = box] 9 [ label = "bb9" shape = box] 10 [ label = "bb10" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Explicit)" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 2 -> 4 [ label = "Normal" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 6 -> 0 [ label = "Error(Implicit)" ] - 7 -> 0 [ label = "Error(Implicit)" , style = "dotted" ] - 6 -> 7 [ label = "Unreachable" , style = "dotted" ] - 8 -> 0 [ label = "Error(Implicit)" ] - 4 -> 5 [ label = "Normal" ] - 7 -> 8 [ label = "Normal" , style = "dotted" ] - 5 -> 6 [ label = "Jump" ] - 4 -> 8 [ label = "Normal" ] - 9 -> 0 [ label = "Error(Implicit)" ] - 8 -> 9 [ label = "Normal" ] - 6 -> 9 [ label = "Jump" ] - 10 -> 0 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "Normal" ] - 3 -> 10 [ label = "Normal" ] - 9 -> 10 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Explicit)", color=red] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 4 [ label="Normal"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 7 [ label="Unreachable", style="dotted"] + 8 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Normal"] + 7 -> 8 [ label="Normal", style="dotted"] + 5 -> 6 [ label="Jump", color=green] + 4 -> 8 [ label="Normal"] + 9 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 9 [ label="Normal"] + 6 -> 9 [ label="Jump", color=green] + 10 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="Normal"] + 3 -> 10 [ label="Normal"] + 9 -> 10 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/labelled_try_break.snap b/crates/oxc_semantic/tests/integration/snapshots/labelled_try_break.snap index d0a50366b3f28..0e54bafd444aa 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/labelled_try_break.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/labelled_try_break.snap @@ -81,26 +81,26 @@ return " shape = box] 11 [ label = "bb11 unreachable" shape = box] 12 [ label = "bb12" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 5 -> 4 [ label = "Finalize" ] - 6 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 6 -> 4 [ label = "Finalize" , style = "dotted" ] - 5 -> 6 [ label = "Unreachable" , style = "dotted" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 4 -> 7 [ label = "Normal" ] - 8 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 7 -> 8 [ label = "Unreachable" , style = "dotted" ] - 9 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 5 [ label = "Normal" ] - 8 -> 9 [ label = "Unreachable" , style = "dotted" ] - 10 -> 2 [ label = "Error(Implicit)" ] - 9 -> 10 [ label = "Normal" , style = "dotted" ] - 7 -> 10 [ label = "Jump" ] - 11 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 10 -> 11 [ label = "Unreachable" , style = "dotted" ] - 12 -> 0 [ label = "Error(Implicit)" ] - 1 -> 12 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 4 [ label="Finalize"] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 4 [ label="Finalize", style="dotted"] + 5 -> 6 [ label="Unreachable", style="dotted"] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 7 [ label="Normal"] + 8 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Unreachable", style="dotted"] + 9 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 5 [ label="Normal"] + 8 -> 9 [ label="Unreachable", style="dotted"] + 10 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 9 -> 10 [ label="Normal", style="dotted"] + 7 -> 10 [ label="Jump", color=green] + 11 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 11 [ label="Unreachable", style="dotted"] + 12 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 12 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/logical_expressions_short_circuit.snap b/crates/oxc_semantic/tests/integration/snapshots/logical_expressions_short_circuit.snap index 0790558a74543..a6e098265ac34 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/logical_expressions_short_circuit.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/logical_expressions_short_circuit.snap @@ -100,41 +100,41 @@ Condition(LogicalExpression)" shape = box] 15 [ label = "bb15 ExpressionStatement" shape = box] 16 [ label = "bb16" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 2 -> 0 [ label = "Error(Implicit)" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 2 -> 3 [ label = "Normal" ] - 2 -> 4 [ label = "Normal" ] - 3 -> 4 [ label = "Normal" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 6 -> 0 [ label = "Error(Implicit)" ] - 1 -> 2 [ label = "Normal" ] - 5 -> 6 [ label = "Normal" ] - 4 -> 5 [ label = "Jump" ] - 1 -> 6 [ label = "Normal" ] - 7 -> 0 [ label = "Error(Implicit)" ] - 8 -> 0 [ label = "Error(Implicit)" ] - 9 -> 0 [ label = "Error(Implicit)" ] - 7 -> 8 [ label = "Normal" ] - 7 -> 9 [ label = "Normal" ] - 8 -> 9 [ label = "Normal" ] - 10 -> 0 [ label = "Error(Implicit)" ] - 11 -> 0 [ label = "Error(Implicit)" ] - 6 -> 7 [ label = "Normal" ] - 10 -> 11 [ label = "Normal" ] - 9 -> 10 [ label = "Jump" ] - 6 -> 11 [ label = "Normal" ] - 12 -> 0 [ label = "Error(Implicit)" ] - 13 -> 0 [ label = "Error(Implicit)" ] - 14 -> 0 [ label = "Error(Implicit)" ] - 12 -> 13 [ label = "Normal" ] - 12 -> 14 [ label = "Normal" ] - 13 -> 14 [ label = "Normal" ] - 15 -> 0 [ label = "Error(Implicit)" ] - 16 -> 0 [ label = "Error(Implicit)" ] - 11 -> 12 [ label = "Normal" ] - 15 -> 16 [ label = "Normal" ] - 14 -> 15 [ label = "Jump" ] - 11 -> 16 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 3 [ label="Normal"] + 2 -> 4 [ label="Normal"] + 3 -> 4 [ label="Normal"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 2 [ label="Normal"] + 5 -> 6 [ label="Normal"] + 4 -> 5 [ label="Jump", color=green] + 1 -> 6 [ label="Normal"] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 9 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Normal"] + 7 -> 9 [ label="Normal"] + 8 -> 9 [ label="Normal"] + 10 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 11 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 7 [ label="Normal"] + 10 -> 11 [ label="Normal"] + 9 -> 10 [ label="Jump", color=green] + 6 -> 11 [ label="Normal"] + 12 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 13 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 14 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 12 -> 13 [ label="Normal"] + 12 -> 14 [ label="Normal"] + 13 -> 14 [ label="Normal"] + 15 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 16 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 11 -> 12 [ label="Normal"] + 15 -> 16 [ label="Normal"] + 14 -> 15 [ label="Jump", color=green] + 11 -> 16 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/member_access_with_numbered_index.snap b/crates/oxc_semantic/tests/integration/snapshots/member_access_with_numbered_index.snap index df2c294c9544b..443a1997de9b7 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/member_access_with_numbered_index.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/member_access_with_numbered_index.snap @@ -44,13 +44,13 @@ return " shape = box] 5 [ label = "bb5 unreachable" shape = box] 6 [ label = "bb6" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 4 -> 5 [ label = "Unreachable" , style = "dotted" ] - 6 -> 0 [ label = "Error(Implicit)" ] - 1 -> 6 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Unreachable", style="dotted"] + 6 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 6 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/member_access_with_unreachable.snap b/crates/oxc_semantic/tests/integration/snapshots/member_access_with_unreachable.snap index acda97da388ee..7ed3ed4d80110 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/member_access_with_unreachable.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/member_access_with_unreachable.snap @@ -44,13 +44,13 @@ return " shape = box] 5 [ label = "bb5 unreachable" shape = box] 6 [ label = "bb6" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 4 -> 5 [ label = "Unreachable" , style = "dotted" ] - 6 -> 0 [ label = "Error(Implicit)" ] - 1 -> 6 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Unreachable", style="dotted"] + 6 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 6 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/nested_computed_member_expression.snap b/crates/oxc_semantic/tests/integration/snapshots/nested_computed_member_expression.snap index da1683745f962..b86034bbf43f0 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/nested_computed_member_expression.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/nested_computed_member_expression.snap @@ -36,11 +36,11 @@ return " shape = box] 4 [ label = "bb4 unreachable" shape = box] 5 [ label = "bb5" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/new_and_meta.snap b/crates/oxc_semantic/tests/integration/snapshots/new_and_meta.snap index a5d708047c7b9..7759a9760869e 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/new_and_meta.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/new_and_meta.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/new_class_then_call_fn.snap b/crates/oxc_semantic/tests/integration/snapshots/new_class_then_call_fn.snap index 078342c2c30d8..9e2bbea5b3553 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/new_class_then_call_fn.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/new_class_then_call_fn.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 VariableDeclaration" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/object_in_computer_member_expression.snap b/crates/oxc_semantic/tests/integration/snapshots/object_in_computer_member_expression.snap index 892ee2a597908..e44e43e035694 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/object_in_computer_member_expression.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/object_in_computer_member_expression.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/parenthesized_and_sequence_expr.snap b/crates/oxc_semantic/tests/integration/snapshots/parenthesized_and_sequence_expr.snap index ad7179a12ca06..98c8e699b5938 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/parenthesized_and_sequence_expr.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/parenthesized_and_sequence_expr.snap @@ -46,13 +46,13 @@ ExpressionStatement" shape = box] 6 [ label = "bb6 ExpressionStatement" shape = box] 7 [ label = "bb7" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 1 -> 4 [ label = "Normal" ] - 6 -> 5 [ label = "Error(Implicit)" ] - 4 -> 6 [ label = "NewFunction" ] - 7 -> 0 [ label = "Error(Implicit)" ] - 4 -> 7 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 4 [ label="Normal"] + 6 -> 5 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 6 [ label="NewFunction"] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 7 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/private_in.snap b/crates/oxc_semantic/tests/integration/snapshots/private_in.snap index 90a76315386b2..4a47eeffb754b 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/private_in.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/private_in.snap @@ -36,11 +36,11 @@ return " shape = box] 4 [ label = "bb4 unreachable" shape = box] 5 [ label = "bb5" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/simple_spread.snap b/crates/oxc_semantic/tests/integration/snapshots/simple_spread.snap index 2bb2be260dee0..ae3142a6bf8dc 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/simple_spread.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/simple_spread.snap @@ -36,11 +36,11 @@ return " shape = box] 4 [ label = "bb4 unreachable" shape = box] 5 [ label = "bb5" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/spread_in_a_spread.snap b/crates/oxc_semantic/tests/integration/snapshots/spread_in_a_spread.snap index f83ee0f7b047e..1816187d477da 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/spread_in_a_spread.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/spread_in_a_spread.snap @@ -36,11 +36,11 @@ return " shape = box] 4 [ label = "bb4 unreachable" shape = box] 5 [ label = "bb5" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/string.snap b/crates/oxc_semantic/tests/integration/snapshots/string.snap index edf5d92c82554..eb08bc64cdffb 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/string.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/string.snap @@ -14,5 +14,5 @@ bb1: { digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/switch_in_while.snap b/crates/oxc_semantic/tests/integration/snapshots/switch_in_while.snap index 6231ffb00116e..d22b641a1ca6a 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/switch_in_while.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/switch_in_while.snap @@ -71,28 +71,28 @@ Condition(1)" shape = box] ExpressionStatement" shape = box] 9 [ label = "bb9" shape = box] 10 [ label = "bb10" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 2 -> 0 [ label = "Error(Implicit)" ] - 3 -> 0 [ label = "Error(Implicit)" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 4 -> 5 [ label = "Jump" ] - 6 -> 0 [ label = "Error(Implicit)" , style = "dotted" ] - 5 -> 6 [ label = "Unreachable" , style = "dotted" ] - 7 -> 0 [ label = "Error(Implicit)" ] - 8 -> 0 [ label = "Error(Implicit)" ] - 7 -> 8 [ label = "Jump" ] - 4 -> 7 [ label = "Normal" ] - 6 -> 7 [ label = "Normal" , style = "dotted" ] - 3 -> 4 [ label = "Normal" ] - 3 -> 7 [ label = "Normal" ] - 9 -> 0 [ label = "Error(Implicit)" ] - 8 -> 9 [ label = "Normal" ] - 3 -> 9 [ label = "Normal" ] - 10 -> 0 [ label = "Error(Implicit)" ] - 1 -> 2 [ label = "Normal" ] - 2 -> 3 [ label = "Jump" ] - 9 -> 2 [ label = "Backedge" ] - 2 -> 10 [ label = "Normal" ] - 5 -> 2 [ label = "Jump" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 2 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Jump", color=green] + 6 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 6 [ label="Unreachable", style="dotted"] + 7 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Jump", color=green] + 4 -> 7 [ label="Normal"] + 6 -> 7 [ label="Normal", style="dotted"] + 3 -> 4 [ label="Normal"] + 3 -> 7 [ label="Normal"] + 9 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 9 [ label="Normal"] + 3 -> 9 [ label="Normal"] + 10 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 2 [ label="Normal"] + 2 -> 3 [ label="Jump", color=green] + 9 -> 2 [ label="Backedge", color=grey] + 2 -> 10 [ label="Normal"] + 5 -> 2 [ label="Jump", color=green] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/switch_statement.snap b/crates/oxc_semantic/tests/integration/snapshots/switch_statement.snap index 73408ed813947..0d2dd1bd77799 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/switch_statement.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/switch_statement.snap @@ -157,67 +157,67 @@ return " shape = box] 21 [ label = "bb21 unreachable" shape = box] 22 [ label = "bb22" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 4 -> 5 [ label = "Jump" ] - 6 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 5 -> 6 [ label = "Unreachable" , style = "dotted" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 8 -> 2 [ label = "Error(Implicit)" ] - 7 -> 8 [ label = "Jump" ] - 9 -> 2 [ label = "Error(Implicit)" ] - 10 -> 2 [ label = "Error(Implicit)" ] - 9 -> 10 [ label = "Jump" ] - 11 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 10 -> 11 [ label = "Unreachable" , style = "dotted" ] - 12 -> 2 [ label = "Error(Implicit)" ] - 13 -> 2 [ label = "Error(Implicit)" ] - 12 -> 13 [ label = "Jump" ] - 14 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 13 -> 14 [ label = "Unreachable" , style = "dotted" ] - 15 -> 2 [ label = "Error(Implicit)" ] - 16 -> 2 [ label = "Error(Implicit)" ] - 15 -> 16 [ label = "Jump" ] - 17 -> 2 [ label = "Error(Implicit)" ] - 18 -> 2 [ label = "Error(Implicit)" ] - 17 -> 18 [ label = "Jump" ] - 19 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 18 -> 19 [ label = "Unreachable" , style = "dotted" ] - 4 -> 7 [ label = "Normal" ] - 4 -> 9 [ label = "Normal" ] - 4 -> 12 [ label = "Normal" ] - 4 -> 15 [ label = "Normal" ] - 4 -> 17 [ label = "Normal" ] - 6 -> 7 [ label = "Normal" , style = "dotted" ] - 3 -> 4 [ label = "Normal" ] - 7 -> 9 [ label = "Normal" ] - 7 -> 12 [ label = "Normal" ] - 7 -> 15 [ label = "Normal" ] - 7 -> 17 [ label = "Normal" ] - 8 -> 9 [ label = "Normal" ] - 3 -> 7 [ label = "Normal" ] - 9 -> 12 [ label = "Normal" ] - 9 -> 15 [ label = "Normal" ] - 9 -> 17 [ label = "Normal" ] - 11 -> 12 [ label = "Normal" , style = "dotted" ] - 3 -> 9 [ label = "Normal" ] - 12 -> 15 [ label = "Normal" ] - 12 -> 17 [ label = "Normal" ] - 14 -> 15 [ label = "Normal" , style = "dotted" ] - 3 -> 12 [ label = "Normal" ] - 15 -> 17 [ label = "Normal" ] - 16 -> 17 [ label = "Normal" ] - 3 -> 15 [ label = "Normal" ] - 3 -> 17 [ label = "Normal" ] - 20 -> 2 [ label = "Error(Implicit)" ] - 19 -> 20 [ label = "Normal" , style = "dotted" ] - 5 -> 20 [ label = "Jump" ] - 10 -> 20 [ label = "Jump" ] - 21 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 20 -> 21 [ label = "Unreachable" , style = "dotted" ] - 22 -> 0 [ label = "Error(Implicit)" ] - 1 -> 22 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Jump", color=green] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 6 [ label="Unreachable", style="dotted"] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Jump", color=green] + 9 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 9 -> 10 [ label="Jump", color=green] + 11 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 10 -> 11 [ label="Unreachable", style="dotted"] + 12 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 13 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 12 -> 13 [ label="Jump", color=green] + 14 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 13 -> 14 [ label="Unreachable", style="dotted"] + 15 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 16 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 15 -> 16 [ label="Jump", color=green] + 17 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 18 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 17 -> 18 [ label="Jump", color=green] + 19 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 18 -> 19 [ label="Unreachable", style="dotted"] + 4 -> 7 [ label="Normal"] + 4 -> 9 [ label="Normal"] + 4 -> 12 [ label="Normal"] + 4 -> 15 [ label="Normal"] + 4 -> 17 [ label="Normal"] + 6 -> 7 [ label="Normal", style="dotted"] + 3 -> 4 [ label="Normal"] + 7 -> 9 [ label="Normal"] + 7 -> 12 [ label="Normal"] + 7 -> 15 [ label="Normal"] + 7 -> 17 [ label="Normal"] + 8 -> 9 [ label="Normal"] + 3 -> 7 [ label="Normal"] + 9 -> 12 [ label="Normal"] + 9 -> 15 [ label="Normal"] + 9 -> 17 [ label="Normal"] + 11 -> 12 [ label="Normal", style="dotted"] + 3 -> 9 [ label="Normal"] + 12 -> 15 [ label="Normal"] + 12 -> 17 [ label="Normal"] + 14 -> 15 [ label="Normal", style="dotted"] + 3 -> 12 [ label="Normal"] + 15 -> 17 [ label="Normal"] + 16 -> 17 [ label="Normal"] + 3 -> 15 [ label="Normal"] + 3 -> 17 [ label="Normal"] + 20 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 19 -> 20 [ label="Normal", style="dotted"] + 5 -> 20 [ label="Jump", color=green] + 10 -> 20 [ label="Jump", color=green] + 21 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 20 -> 21 [ label="Unreachable", style="dotted"] + 22 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 22 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/template_literal.snap b/crates/oxc_semantic/tests/integration/snapshots/template_literal.snap index 141d8d8d0a20f..ad318823fbcd8 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/template_literal.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/template_literal.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/template_string.snap b/crates/oxc_semantic/tests/integration/snapshots/template_string.snap index 1d7ec989b99c9..3f59536233347 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/template_string.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/template_string.snap @@ -15,5 +15,5 @@ digraph { 0 [ label = "bb0" shape = box] 1 [ label = "bb1 ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/two_functions.snap b/crates/oxc_semantic/tests/integration/snapshots/two_functions.snap index e385e9b5be406..b19a8bd2a9625 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/two_functions.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/two_functions.snap @@ -58,17 +58,17 @@ return " shape = box] 8 [ label = "bb8 unreachable" shape = box] 9 [ label = "bb9" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 3 -> 4 [ label = "Unreachable" , style = "dotted" ] - 5 -> 0 [ label = "Error(Implicit)" ] - 1 -> 5 [ label = "Normal" ] - 7 -> 6 [ label = "Error(Implicit)" ] - 5 -> 7 [ label = "NewFunction" ] - 8 -> 6 [ label = "Error(Implicit)" , style = "dotted" ] - 7 -> 8 [ label = "Unreachable" , style = "dotted" ] - 9 -> 0 [ label = "Error(Implicit)" ] - 5 -> 9 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Unreachable", style="dotted"] + 5 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 5 [ label="Normal"] + 7 -> 6 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 7 [ label="NewFunction"] + 8 -> 6 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Unreachable", style="dotted"] + 9 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 9 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/unary_operator.snap b/crates/oxc_semantic/tests/integration/snapshots/unary_operator.snap index eb06e72d388bf..41844fa578851 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/unary_operator.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/unary_operator.snap @@ -19,5 +19,5 @@ digraph { ExpressionStatement ExpressionStatement ExpressionStatement" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/while.snap b/crates/oxc_semantic/tests/integration/snapshots/while.snap index 099b9e799a690..deff61c0d4533 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/while.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/while.snap @@ -72,25 +72,25 @@ return " shape = box] 10 [ label = "bb10 unreachable" shape = box] 11 [ label = "bb11" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 2 [ label = "Error(Implicit)" ] - 5 -> 2 [ label = "Error(Implicit)" ] - 6 -> 2 [ label = "Error(Implicit)" ] - 4 -> 5 [ label = "Normal" ] - 4 -> 6 [ label = "Normal" ] - 5 -> 6 [ label = "Normal" ] - 7 -> 2 [ label = "Error(Implicit)" ] - 8 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 7 -> 8 [ label = "Unreachable" , style = "dotted" ] - 9 -> 2 [ label = "Error(Implicit)" ] - 3 -> 4 [ label = "Normal" ] - 4 -> 7 [ label = "Jump" ] - 8 -> 4 [ label = "Backedge" , style = "dotted" ] - 4 -> 9 [ label = "Normal" ] - 10 -> 2 [ label = "Error(Implicit)" , style = "dotted" ] - 9 -> 10 [ label = "Unreachable" , style = "dotted" ] - 11 -> 0 [ label = "Error(Implicit)" ] - 1 -> 11 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 5 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 6 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 4 -> 5 [ label="Normal"] + 4 -> 6 [ label="Normal"] + 5 -> 6 [ label="Normal"] + 7 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 8 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 7 -> 8 [ label="Unreachable", style="dotted"] + 9 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 4 [ label="Normal"] + 4 -> 7 [ label="Jump", color=green] + 8 -> 4 [ label="Backedge", style="dotted", color=grey] + 4 -> 9 [ label="Normal"] + 10 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 9 -> 10 [ label="Unreachable", style="dotted"] + 11 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 11 [ label="Normal"] } diff --git a/crates/oxc_semantic/tests/integration/snapshots/yield_as_statement_and_expression.snap b/crates/oxc_semantic/tests/integration/snapshots/yield_as_statement_and_expression.snap index 600520d6eb38d..09a16b6ec12c7 100644 --- a/crates/oxc_semantic/tests/integration/snapshots/yield_as_statement_and_expression.snap +++ b/crates/oxc_semantic/tests/integration/snapshots/yield_as_statement_and_expression.snap @@ -33,9 +33,9 @@ VariableDeclaration" shape = box] ExpressionStatement ExpressionStatement" shape = box] 4 [ label = "bb4" shape = box] - 1 -> 0 [ label = "Error(Implicit)" ] - 3 -> 2 [ label = "Error(Implicit)" ] - 1 -> 3 [ label = "NewFunction" ] - 4 -> 0 [ label = "Error(Implicit)" ] - 1 -> 4 [ label = "Normal" ] + 1 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 3 -> 2 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 3 [ label="NewFunction"] + 4 -> 0 [ label="Error(Implicit)", style=dashed, color=red] + 1 -> 4 [ label="Normal"] }