From 4ea0aacdb46f8ef46f7d2b8f8e51a4dc00b5e7d0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 13 Nov 2023 18:28:14 +0000 Subject: [PATCH] feat(printer) Print `ThrowStatement` (#1275) --- crates/oxc_prettier/src/format.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/oxc_prettier/src/format.rs b/crates/oxc_prettier/src/format.rs index 2d6ef9d79..f3cf704bb 100644 --- a/crates/oxc_prettier/src/format.rs +++ b/crates/oxc_prettier/src/format.rs @@ -203,7 +203,12 @@ impl<'a> Format<'a> for TryStatement<'a> { impl<'a> Format<'a> for ThrowStatement<'a> { fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> { - Doc::Line + let mut parts = p.vec(); + parts.push(string!(p, "throw ")); + parts.push(string!(p, " ")); + parts.push(format!(p, self.argument)); + + Doc::Array(parts) } }