Trapped in ES5

One of the platform that I develop and maintain for my current employer is LG SmartTV App and the oldest TV version we support is LG TV with webOS 3.5. Most of the TVs with this OS were released in 2017, but the OS itself is based on Chromium 38 which was released in August 2014, ~3 years before.

Everything is fine since we transpile our code into ES5 using Babel. But, when I need to update the legacy scripts inside index.html that is not transpiled, something surprised me.

I put a default parameter into a javascript function and it makes the app won’t run on that webOS version. I realized a default parameter is part of ES6 and available since Chromium 49. Luckily we managed to fixed that before it released to production.

It’s funny, I thought that feature was already available for a long time but apparently the OS cannot handle it. As a programmer who’s been coding javascript before the ES6 existence, I already forgot the excitement when welcoming the ES6 features so I thought its released a decade ago. Thanks to caniuse.com we can always check the browser/engine support.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.