Function "" not found

Posted on
  • I've noticed this error pop up in 2v06 (I think as a side effect of pretokenise being enabled by default on 2v06). I seem to remember seeing a thread with an example of it recently, but I can't find it now.

    If you encounter this, please can you post up the code that caused the error? Ideally stripped down to a minimum. It might help to track it down.

    Thanks!

  • Thanks! Looks like my google skills failed me then :)

    I'd got it happening myself when trying to do the new "Espruino Control" app, so it might be related to the bluetooth code more than a language issue

  • Ok, great! Narrowed it down to:

    //E.setFlags({pretokenise:0}) // this fixes it
    function go() {
      Promise.resolve().then(function() {
        console.log("Ok");
      }).catch(function(e) {
        console.log("ERROR",e);
      });
    }
    go()
    

    So it's to do with catch being converted to a token even though in this case it's just a function name. Just filed an issue: https://github.com/espruino/Espruino/issues/1868

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Function "" not found

Posted by Avatar for Gordon @Gordon

Actions