var uglifyjs = require('uglify-js')
var code = `
(function() {
var foo = function Symbol() { return 'foo'; }
if (typeof Symbol === "function" && Symbol.iterator) {
console.log('bar')
}
console.log('...')
function Foo() {
if (!(this instanceof Foo)) throw new Error("constructor can't be called directly");
}
window.Foo = Foo;
}())
`
var minified = uglifyjs.minify(code, { ie8: true, output: { beautify: true } }).code
console.log(minified)
eval(minified)