-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
bugSomething isn't workingSomething isn't workingbundlerSomething to do with the bundlerSomething to do with the bundler
Description
What version of Bun is running?
1.2.9
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
bun build the following
const str = 'n/a';
console.log(str);
What is the expected behavior?
const remaining const, or at most being converted to let
What do you see instead?
var str
Additional information
Considering var has side effects and is generally undesirable in almost every context except when explicitly desired, the build process converting my const to var seems very strange. It also behaves differently from const so that makes this doubly strange, tho if no re-assignments are detected, it's probably fine from that angle.
However, it should be converted to let at most, not var.
den59k and nikhil-marne
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingbundlerSomething to do with the bundlerSomething to do with the bundler