mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
feat(printer) Print UpdateExpression (#1272)
This commit is contained in:
parent
1fb12d0088
commit
a7acd07df8
1 changed files with 11 additions and 1 deletions
|
|
@ -607,7 +607,17 @@ impl<'a> Format<'a> for YieldExpression<'a> {
|
|||
|
||||
impl<'a> Format<'a> for UpdateExpression<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
let mut parts = p.vec();
|
||||
|
||||
parts.push(p.str(self.operator.as_str()));
|
||||
|
||||
parts.push(format!(p, self.argument));
|
||||
|
||||
if self.prefix {
|
||||
parts.reverse();
|
||||
}
|
||||
|
||||
Doc::Array(parts)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue