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

Arithmetic expression may have side effect even with current assumption #9938

Open
Austaras opened this issue Jan 24, 2025 · 0 comments
Open
Labels

Comments

@Austaras
Copy link
Member

Austaras commented Jan 24, 2025

Describe the bug

Currently SWC minifier would assume toString and valueOf to be pure so it would remove a + b. However if a is number and b is BigInt, it would result in a TypeError

Input code

export function foo(a, b) {
    a + b
}

Config

Playground link (or link to the minimal reproduction)

link

SWC Info output

No response

Expected behavior

No idea

Actual behavior

export function foo(a, b) {
}

Version

Additional context

terser/terser#1301

@Austaras Austaras added the C-bug label Jan 24, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2025
@Austaras Austaras reopened this Jan 24, 2025
@swc-project swc-project unlocked this conversation Jan 24, 2025
@swc-project swc-project deleted a comment from github-actions bot Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant