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

WIP: fix: don't drop side effects of default param assignments #1148

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WofWca
Copy link
Contributor

@WofWca WofWca commented Feb 16, 2022

Closes #880

Here's my draft, finally. It is said in #880 (comment) that there's lots of places that need changes related to #880, but this only touches one - function call drops (but even this should be taken with a grain of salt - I'm not super experienced with this stuff).

Hopefully it can still be of use.

@WofWca WofWca force-pushed the param-default-assign-side-effects branch 3 times, most recently from 044fcc3 to 20f72c3 Compare February 17, 2022 15:08
@WofWca WofWca force-pushed the param-default-assign-side-effects branch from 20f72c3 to f4201be Compare February 17, 2022 15:37
arg.is_boolean()
|| arg.is_number()
|| arg.is_string()
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to create a is_not_undefined in compress/inference.js and use that. This way there's no implicit dependency between is_constant and !is_undefined that needs to be maintained and remembered.

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

Successfully merging this pull request may close these issues.

bug: possible side effect in optional param is ignored
2 participants