You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executing the bundled output should yield the same result as executing the source.
The dead code detection should assume the same possibility for side effects in the prototype for natively declared array instances as it does for those declared with new Array().
Actual Behaviour
I assume it assumes we are accessing a property that doesn't exist (as it usually doesn't on arrays), which is very ambitious, but not save as illustrated in the repl above.
The text was updated successfully, but these errors were encountered:
Yes, this is a known limitation that we assume built-ins have not been tampered with. One could argue, though, that with respect to future prototype features that are not yet known to rollup, missing prototype properties should be handled as unknown instead of undefined.
Rollup Version
2.69.0
Operating System (or Browser)
MacOs chrome
Node Version (if applicable)
No response
Link To Reproduction
https://rollupjs.org/repl/?version=2.69.0&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmNvbnN0JTIwYXJyJTIwJTNEJTIwJTVCJTVEJTIwJTJGJTJGJTIwbmV3JTIwQXJyYXkoKSUyMCUyRiUyRiUyMHdvdWxkJTIwd29yayU1Q24lNUNuJTVDbk9iamVjdC5kZWZpbmVkUHJvcGVydHkoQXJyYXkucHJvdG90eXBlJTJDJTIwJTVDJTIyaXNFbXB0eSU1QyUyMiUyQyUyMCU3QiUyMCUyRiUyRiUyME9iamVjdC5kZWZpbmVkUHJvcGVydHkoYXJyJTIwJTJGJTJGJTIwd291bGQlMjB3b3JrJTVDbiUyMCUyMGdldCgpJTIwJTdCJTVDbiU1Q3QlMjAlMjByZXR1cm4lMjB0aGlzLmxlbCUyMCUzRCUzRCUzRCUyMDAlNUNuJTVDdCU3RCU1Q24lN0QpJTVDbiU1Q25jb25zdCUyMGYlMjAlM0QlMjAoKSUyMCUzRCUzRSUyMCU3QiU1Q24lMjAlMjBpZiUyMChhcnIuaXNFbXB0eSklMjBjb25zb2xlLmxvZyglNUMlMjJXT1JLUyU1QyUyMiklMjAlMkYlMkYlMjBhcnIuaXNFbXB0eSgpJTIwJTJGJTJGJTIwd291bGQlMjB3b3JrJTVDbiUyMCUyMGVsc2UlMjBjb25zb2xlLmxvZyglNUMlMjIuLi4lNUMlMjIpJTVDbiU1Q3QlNUNuJTIwJTIwYXJyLnB1c2goJTVDJTIyd2hhdGV2ZXIlNUMlMjIpJTIwJTJGJTJGJTIwcmVzdGFydGluZ0NvdXNPZi5sZW5ndGglMkIlMkIlMjAlMkYlMkYlMjB3b3VsZG50JTIwd29yayU1Q24lN0QlNUNuJTVDbmYoKSU1Q25mKCklNUNuJTVDbiUyRiUyRiUyMGNvbnNvbGUubG9nKHJlc3RhcnRpbmdDb3VzT2YpJTIwJTJGJTJGJTIwd291bGQlMjB3b3JrJTIwYXMlMjB0aGUlMjBtdXRhdGlvbnMlMjB0byUyMGFyciUyMGFyZSUyMGltcG9ydGFudCUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTVEJTJDJTIyb3B0aW9ucyUyMiUzQSU3QiUyMmZvcm1hdCUyMiUzQSUyMmVzJTIyJTJDJTIybmFtZSUyMiUzQSUyMm15QnVuZGxlJTIyJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTdEJTJDJTIyZXhhbXBsZSUyMiUzQW51bGwlN0Q=
Expected Behaviour
Executing the bundled output should yield the same result as executing the source.
The dead code detection should assume the same possibility for side effects in the prototype for natively declared array instances as it does for those declared with
new Array()
.Actual Behaviour
I assume it assumes we are accessing a property that doesn't exist (as it usually doesn't on arrays), which is very ambitious, but not save as illustrated in the repl above.
The text was updated successfully, but these errors were encountered: