We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We have never reproduced this issue on the wild, but I thought it could be a problem after going though the rollup's code. Low priority.
https://rollupjs.org/repl?version=1.14.6&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMiU1Q25mdW5jdGlvbiUyMHNpZGVFZmZlY3RzKCklMjAlN0IlNUNuJTVDdGNvbnNvbGUubG9nKCdwcmludCUyMG1lc3NhZ2UnKSUzQiU1Q24lNUN0cmV0dXJuJTIwdHJ1ZSUzQiU1Q24lN0QlNUNuJTVDbmZ1bmN0aW9uJTIwaG9sYShhJTJDJTIwYiklMjAlN0IlNUNuJTVDdGNvbnNvbGUubG9nKGEpJTNCJTVDbiU3RCU1Q24lNUNuaG9sYSgxJTJDJTIwc2lkZUVmZmVjdHMoKSklM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBdHJ1ZSU3RCU1RCUyQyUyMm9wdGlvbnMlMjIlM0ElN0IlMjJmb3JtYXQlMjIlM0ElMjJjanMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==
It should not drop the call to sideEffects(), since it might have side effects, it's not safe to drop. Giving this entry-point:
function sideEffects() { console.log('print message'); return true; } function hola(a, b) { console.log(a); } hola(1, sideEffects());
it should emit:
It drops the side effect function if the parameter is unused.
function hola(a, b) { console.log(a); } hola(1);
so the console.log() is never printed
The text was updated successfully, but these errors were encountered:
Interesting, I distinctly remember having written code to prevent this. Will need to check again and add more tests.
Sorry, something went wrong.
Thanks again for finding this, the fix was indeed as simple as an if instead of an else if. And a missed test case. Fix at #2924
if
else if
Awesome job @lukastaegert ! you rock
Successfully merging a pull request may close this issue.
We have never reproduced this issue on the wild, but I thought it could be a problem after going though the rollup's code. Low priority.
How Do We Reproduce?
https://rollupjs.org/repl?version=1.14.6&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMiU1Q25mdW5jdGlvbiUyMHNpZGVFZmZlY3RzKCklMjAlN0IlNUNuJTVDdGNvbnNvbGUubG9nKCdwcmludCUyMG1lc3NhZ2UnKSUzQiU1Q24lNUN0cmV0dXJuJTIwdHJ1ZSUzQiU1Q24lN0QlNUNuJTVDbmZ1bmN0aW9uJTIwaG9sYShhJTJDJTIwYiklMjAlN0IlNUNuJTVDdGNvbnNvbGUubG9nKGEpJTNCJTVDbiU3RCU1Q24lNUNuaG9sYSgxJTJDJTIwc2lkZUVmZmVjdHMoKSklM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBdHJ1ZSU3RCU1RCUyQyUyMm9wdGlvbnMlMjIlM0ElN0IlMjJmb3JtYXQlMjIlM0ElMjJjanMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==
Expected Behavior
It should not drop the call to sideEffects(), since it might have side effects, it's not safe to drop.
Giving this entry-point:
it should emit:
Actual Behavior
It drops the side effect function if the parameter is unused.
so the console.log() is never printed
The text was updated successfully, but these errors were encountered: