mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(codegen): fix whitespace issue when minifying x in new Error() (#4886)
This commit is contained in:
parent
c164bb8b64
commit
e8de4bde41
2 changed files with 2 additions and 0 deletions
|
|
@ -2101,6 +2101,7 @@ impl<'a, const MINIFY: bool> GenExpr<MINIFY> for NewExpression<'a> {
|
|||
if let Some(comment) = annotate_comment {
|
||||
p.print_comment(comment);
|
||||
}
|
||||
p.print_space_before_identifier();
|
||||
p.add_source_mapping(self.span.start);
|
||||
p.print_str("new ");
|
||||
self.callee.gen_expr(p, Precedence::New, Context::FORBID_CALL);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ fn expr() {
|
|||
}",
|
||||
"class Foo {\n\t#test;\n\tbar() {\n\t\tif (!(#test in Foo)) {}\n\t}\n}\n",
|
||||
);
|
||||
test_minify("x in new Error()", "x in new Error();");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue