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

code incorrectly dropped #4161

Closed
CarloCannas opened this issue Jul 1, 2021 · 4 comments · Fixed by #4162
Closed

code incorrectly dropped #4161

CarloCannas opened this issue Jul 1, 2021 · 4 comments · Fixed by #4162
Assignees

Comments

@CarloCannas
Copy link

Rollup Version

v2.50.5

Operating System (or Browser)

n/a

Node Version (if applicable)

No response

Link To Reproduction

https://rollupjs.org/repl/?version=2.50.5&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmZ1bmN0aW9uJTIwZm4oKSU3QiU1Q24lMjAlMjBjb25zdCUyMG9iaiUyMCUzRCUyMCU3QiU1Q24lNUN0JTVDdHRlc3QoKSUyMCU3QiU1Q24lMjAlNUN0JTVDdCUyMGlmJTIwKHR5cGVvZiUyMG9iai50ZXN0Zm4lMjAlM0QlM0QlM0QlMjAlNUMlMjJmdW5jdGlvbiU1QyUyMiklN0JvYmoudGVzdGZuKCklN0QlNUNuJTVDdCU1Q3QlN0QlNUNuJTVDdCU3RCUzQiU1Q24lMjAlMjAlNUNuJTIwJTIwcmV0dXJuJTIwb2JqJTNCJTVDbiU3RCU1Q24lNUNuKGFzeW5jJTIwZnVuY3Rpb24oKSU3QiU1Q24lNUN0Y29uc3QlMjBvYmolMjAlM0QlMjBhd2FpdCUyMGZuKCklM0IlNUNuJTVDdG9iai50ZXN0Zm4lMjAlM0QlMjAoKSUyMCUzRCUzRSUyMGNvbnNvbGUubG9nKCU1QyUyMnlheSU1QyUyMiklM0IlNUNuJTVDdG9iai50ZXN0KCklM0IlNUNuJTdEKSgpJTNCJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==

Expected Behaviour

The statement if (typeof obj.testfn === "function"){obj.testfn()} is present in output, running the code prints yay in the console.

Actual Behaviour

Rollup drops line 4, running the output code doesn't print anything in console.

Version 2.50.5 seems to be the one which introduced the issue: on 2.50.4 line 4 isn't dropped.

Is seems to be async/await releated: removing await from the iife body produces the expected output, adding async to fn instead makes the issue appear again.

Seems a regression introduced by #4115

@lukastaegert
Copy link
Member

Thanks for spotting, fix at #4162

@CarloCannas
Copy link
Author

Wow, thank you for the really quick fix!

@lukastaegert
Copy link
Member

Turns out it was only the async keyword, which triggered a different, albeit related issue. Fix at #4163.

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