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

treeshake bug: object spread side effects incorrectly dropped #4093

Closed
kzc opened this issue May 25, 2021 · 1 comment · Fixed by #4113
Closed

treeshake bug: object spread side effects incorrectly dropped #4093

kzc opened this issue May 25, 2021 · 1 comment · Fixed by #4113

Comments

@kzc
Copy link
Contributor

kzc commented May 25, 2021

  • Rollup Version: rollup v2.50.0
  • Operating System (or Browser): n/a
  • Node Version (if applicable): n/a

Repro

$ cat object-spread-effects.js
let result = "FAIL";
const unused = ({
    ...{
        get prop() {
            result = "PASS";
        }
    }
});
console.log(result);

Expected Behavior

$ cat object-spread-effects.js | node
PASS

Actual Behavior

$ cat object-spread-effects.js | rollup --silent | node
FAIL
$ cat object-spread-effects.js | rollup --silent
let result = "FAIL";
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants