Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(codegen): missing parenthesis on negative bigint literals #8257

Closed
camc314 opened this issue Jan 5, 2025 · 1 comment · Fixed by #8258
Closed

bug(codegen): missing parenthesis on negative bigint literals #8257

camc314 opened this issue Jan 5, 2025 · 1 comment · Fixed by #8258
Labels
C-bug Category - Bug

Comments

@camc314
Copy link
Contributor

camc314 commented Jan 5, 2025

oxc playground

esbuild

For the following input:

(-1n).toString()

oxc produces:

-1n.toString()

this is incorrect, as the second negats the return value of the call expression, whereas the first negats the big int

@camc314 camc314 added the C-bug Category - Bug label Jan 5, 2025
@camc314 camc314 changed the title bug(codegen_ bug(codegen): missing parenthesis on negative bigint literals Jan 5, 2025
Boshen pushed a commit that referenced this issue Jan 6, 2025
#8258)

closes #8257

i couldn't really write a test for this, as it only happens when codegen + minifier are used together.

Regression should be prevented by the 262 suite in #8256 (failed CI run before i implemented this fix: https://github.com/oxc-project/oxc/actions/runs/12621310419/job/35168016825)
@overlookmotel
Copy link
Contributor

Fixed in #8258.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants