You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Ok, just checked this out, you can reproduce it just with:

    setWatch(function (ptt) {
      if (ptt.state) {
        print(32, () => {});
      } else {
        print(0, () => {});
    }, BTN, {edge: "both", debounce: 50, repeat: true});

    It says:

    Uncaught SyntaxError: Got ';' expected EOF
     at line 1 col 33

    Basically Espruino doesn't like the minification to ()=>; - which seems fair. If you try running console.log(32,()=>;) in the browser or node.js then it returns an error - so this seems to be a bug in the minifier!

    If you really do want to keep minifying (although there really isn't any need for what you have right now) teh try changing () => {} to _=>0 - it'll save a few characters and will minify properly.


Avatar for Gordon @Gordon started