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
if(globalThis.notDead){console.log('true-branch');}elseif(false){varw;// `const` works fine hereconsole.log('else-if-branch');}else{console.log('else-branch');}
The text was updated successfully, but these errors were encountered:
shrinktofit
changed the title
[BUG] Hoist variables from dead branch change program semantics
[BUG] Hoist variables from dead branch unexpecedtly change program semantics
Sep 15, 2020
shrinktofit
changed the title
[BUG] Hoist variables from dead branch unexpecedtly change program semantics
[BUG] Variables from dead else-if branch are hoisted to incorrect location
Sep 15, 2020
#3752 did not consider such case:
which incorrectly outputs:
Repl(since
2.26.7
): https://rollupjs.org/repl/?version=2.26.7&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmlmJTIwKGdsb2JhbFRoaXMubm90RGVhZCklMjAlN0IlNUNuJTIwJTIwJTIwJTIwY29uc29sZS5sb2coJ3RydWUtYnJhbmNoJyklM0IlNUNuJTdEJTIwZWxzZSUyMGlmJTIwKGZhbHNlKSUyMCU3QiU1Q24lMjAlMjAlMjAlMjB2YXIlMjB3JTNCJTVDbiU1Q3QlMjAlMjBjb25zb2xlLmxvZygnZWxzZS1pZi1icmFuY2gnKSUzQiU1Q24lN0QlMjBlbHNlJTIwJTdCJTVDbiUyMCUyMCUyMCUyMGNvbnNvbGUubG9nKCdlbHNlLWJyYW5jaCcpJTNCJTVDbiU3RCUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTVEJTJDJTIyb3B0aW9ucyUyMiUzQSU3QiUyMmZvcm1hdCUyMiUzQSUyMmVzJTIyJTJDJTIybmFtZSUyMiUzQSUyMm15QnVuZGxlJTIyJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTdEJTJDJTIyZXhhbXBsZSUyMiUzQW51bGwlN0Q=The text was updated successfully, but these errors were encountered: