"Nested" arrow function SyntaxError on 1v90

Posted on
  • Hi all, I'm seeing this:

    var Util = {
        foo:x=>x.forEach(e=>console.log(e.length))
    };
    

    This is valid ES6 code (https://repl.it/EyUS/0), yet:

    Uncaught SyntaxError: Got ID:console expected ','
     at line 3 col 23
      foo:(x)=>x.forEach(e=>console.log(e.length))
                          ^
     at line 3 col 25
      foo:(x)=>x.forEach(e=>console.log(e.length))
                            ^
    

    Am I misunderstanding something, or is this a bug in the interpreter?

  • Thanks - looks like an interpreter bug to me - I've just filed an issue for it: https://github.com/espruino/Espruino/issues/1011

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

"Nested" arrow function SyntaxError on 1v90

Posted by Avatar for Ron @Ron

Actions