Bug report or feature request?
Bug.
Uglify version (uglifyjs -V)
$ uglifyjs -V
uglify-js 3.8.1
JavaScript input
var echo = (function () {
function _tzset() {
if (!_tzset.called) {
_tzset.called = true;
console.warn('you must see this once');
}
}
return function echo(v) {
_tzset();
console.log(v);
};
})();
echo(1);
echo(2);
The uglifyjs CLI command executed or minify() options used.
uglifyjs -c unused -b width=70 test.js
JavaScript output or error produced.
var echo = function(v) {
!function _tzset() {
_tzset.called || (_tzset.called = !0, console.warn("you must see this once"));
}(), console.log(v);
};
echo(1), echo(2);
The message you must see this once will be mistakenly seen twice.
Thanks for the detailed report - will investigate 馃憤
That was fast, thanks!
You are welcome 馃槈
(Assuming nothing bad pops up in testing, except a new release next Monday.)