Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Upgrade Closure Compiler to avoid kotlin minification errors #160

Open
proofrock opened this issue May 5, 2018 · 0 comments
Open

Upgrade Closure Compiler to avoid kotlin minification errors #160

proofrock opened this issue May 5, 2018 · 0 comments

Comments

@proofrock
Copy link

proofrock commented May 5, 2018

I’m trying to reduce the size of the javascript I’m deploying, for a project I’m developing in kotlin/js.

Since I’m using Gradle, I imported this plugin. If I apply it to the (DCE’d) kotlin.js, I get a number of errors like this:

[…]\build\kotlin-js-min\main\kotlin.js:3387 - Parse error. identifier is a reserved word

This is because of methods like this:

function digitOf(char, radix) {
      var tmp$;
      if (char >= (48 | 0) && char <= (57 | 0))
        tmp$ = char - 48;
      else if (char >= (65 | 0) && char <= (90 | 0))
        tmp$ = char - 65 + 10 | 0;
      else if (char >= (97 | 0) && char <= (122 | 0))
        tmp$ = char - 97 + 10 | 0;
      else
        tmp$ = -1;
      var it = tmp$;
      return it >= radix ? -1 : it;
    }

On the other hand, I tried also with the online service (https://closure-compiler.appspot.com/home), and actually it doesn’t complain. So it seems that the problem was solved upstream; but I dont know how (if it's even possible) to use a newer version of CC with the plugin.

Thanks,

--Germano

PS: reported also in kotlin forum, here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant