rspivak / slimit

SlimIt - a JavaScript minifier/parser in Python
MIT License
551 stars 94 forks source link

Having promise catch statement breaks the minification #106

Open jpmohan1111 opened 6 years ago

jpmohan1111 commented 6 years ago

var i = document.getElementById('videoElement'); console.log(i); // i.load(); var a = i.play(); if (a !== undefined) { a.then(function() { console.log('play worked.'); }) .catch(function(error){ console.error('ERROR!!') console.error(error); }); }

I am trying to minify the above code with slimit, getting error as "Unexpected token (CATCH, 'catch')"

metatoaster commented 6 years ago

Exact same issue as #52, #59, #103, #105 due to keywords not being recognised as identifiers.