Rich-Harris / butternut

The fast, future-friendly minifier
https://butternut.now.sh
MIT License
1.17k stars 17 forks source link

Bug: charFrequency is not defined in some cases #154

Open loilo opened 7 years ago

loilo commented 7 years ago

Trying to squash some cdnjs sources (e.g. angular-timer) with 0.4.6 introduced a new error.

It boils down to the freshly introduced program.charFrequency property not being initialized yet when the first calls to program.addWord() come in, throwing errors in that very method.

I'll attach a PR fixing this.

nifgraup commented 7 years ago

code merged, issue can be closed