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

Minifier: #__PURE__ marked optional chain expression with side-effect in arguments #3991

Open
KermanX opened this issue Nov 28, 2024 · 0 comments

Comments

@KermanX
Copy link

KermanX commented Nov 28, 2024

Current behavior:

/*#__PURE__*/ unknown?.(effect()) // =====> effect();

If unknown is nullish, in the original code, effect() won't be called, but in the output code, it will.

Playground link

Expected behavior:

The output should be either:

  • Preserve the original code
  • unknown !== null && unknown !== undefined && effect()
@KermanX KermanX changed the title #__PURE__ marked optional chain expression with side-effect in arguments Minifier: #__PURE__ marked optional chain expression with side-effect in arguments Nov 28, 2024
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

No branches or pull requests

1 participant