feat(printer) Print ThrowStatement (#1275)

This commit is contained in:
Cameron 2023-11-13 18:28:14 +00:00 committed by GitHub
parent f892a9e8a1
commit 4ea0aacdb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}
}