slimit icon indicating copy to clipboard operation
slimit copied to clipboard

Having promise catch statement breaks the minification

Open jpmohan1111 opened this issue 6 years ago • 1 comments

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')"

jpmohan1111 avatar Sep 12 '18 09:09 jpmohan1111

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

metatoaster avatar Sep 12 '18 09:09 metatoaster