mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
fix(codegen): fix incorrect minified return 1n output (#8374)
This commit is contained in:
parent
cb098c7d3c
commit
a1752a062c
2 changed files with 5 additions and 2 deletions
|
|
@ -1324,9 +1324,9 @@ impl GenExpr for NumericLiteral<'_> {
|
|||
|
||||
impl GenExpr for BigIntLiteral<'_> {
|
||||
fn gen_expr(&self, p: &mut Codegen, precedence: Precedence, _ctx: Context) {
|
||||
let raw = self.raw.as_str().cow_replace('_', "");
|
||||
|
||||
p.print_space_before_identifier();
|
||||
p.add_source_mapping(self.span);
|
||||
let raw = self.raw.as_str().cow_replace('_', "");
|
||||
if !raw.starts_with('-') {
|
||||
p.print_str(&raw);
|
||||
} else if precedence >= Precedence::Prefix {
|
||||
|
|
|
|||
|
|
@ -402,6 +402,9 @@ fn big_int() {
|
|||
test("0xfabn", "0xfabn;\n");
|
||||
test("0xaef_en;", "0xaefen;\n");
|
||||
test("0xaefen;", "0xaefen;\n");
|
||||
|
||||
test("return 1n", "return 1n;\n");
|
||||
test_minify("return 1n", "return 1n;");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue