0

t.exports = function(t, e={}) {
            if (e = Object.assign({}, r, e),
            !t || "string" != typeof t)
                return t;
            let o = t.trim();
            if (void 0 !== e.skipLike && e.skipLike.test(o))
                return t;
            if (e.hex && n.test(o))
                return Number.parseInt(o, 16);
            {
                const n = i.exec(o);
                if (n) {
                    const i = n[2]
                      , r = n[3];
                    return 1 === i.length && "." === r[0] ? Number(t) : !e.leadingZeros && i.length > 0 ? t : Number(o)
                }
                return t
            }
        }

The above code is generated after the build of angular4 application in production mode and found in main.js file. I am using kendo angular in my application. When i open the application in IE11 browser it throws an error in console

SCRIPT1006: Expected ')'

And does not load the application. I am trying to figure out which module or kendo file contains this code or which version of kendo angular module needs to be updated.

The root cause is

if (e.hex && n.test(o))
                    return Number.parseInt(o, 16);
                {
                    const n = i.exec(o);
                    if (n) {
                        const i = n[2]
                          , r = n[3];
                        return 1 === i.length && "." === r[0] ? Number(t) : !e.leadingZeros && i.length > 0 ? t : Number(o)
                    }
                    return t
                }

this part of the code has a return statement after the if condition and before the if block. This is ignored in Chrome and Edge but IE11 is not able to understand and throwing the above mentioned error . Can anyone help me out with this issue.

Thanks in Advance

1
  • May I know if you have got any chance to check my answer? I am glad to help if you have any other questions. Commented Sep 29, 2021 at 5:33

1 Answer 1

0

According to your description, I think the problem is mainly due to the fact that IE does not support ES6 syntax, such as Default parameters. In the code you provided, it is something like this:

function(t, e={}) {
      ...
        }

What you can do is to translate these codes. Try using Babel, it should help you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.