JSqueeze library in Minify JS is failing for await and async operator in JS

Created on 3 May 2021, over 3 years ago
Updated 18 April 2023, over 1 year ago

Problem/Motivation

JSqueeze library in Minify JS is failing for await and async in JS

Steps to reproduce

If 'await' operator is used in JS, then the JSqueeze is failing to minify that.

Example code is -

      const getCameraSelection = async () => {
        const devices = await navigator.mediaDevices.enumerateDevices();
        const videoDevices = devices.filter(device => device.kind === 'videoinput');
        if (videoDevices.length >= 1 ) {
          startVideo();
        }
        else {
          showErrorMessage('NotFoundError');
        }
      };

Minified JS for above section is -

const getCameraSelection=async()=>{const devices=await;navigator.mediaDevices.enumerateDevices();const videoDevices=devices.filter(device=>device.kind==="videoinput");if(videoDevices.length>=1){d()}

';' after await is invalid.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India renukakulkarni

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024