arrow function does not work #4881
Replies: 1 comment
-
Posted at 2020-03-06 by Robin Thr 2020.03.05 Hi @@mrbbp I just tried the snippet in post #1, commenting out L12, running on a MDBT42Q breakout board and get the following:
First, try commenting out L6 and re-run the test. If successful, then it is most likely the first argument's value for the 'pin' parameter. Second, the *Uncaught SyntaxError* output is parsed different than L7 Are we sure the *Exact* code block is being supplied, or was this a trimmed down version for demonstration?
Third, Please post the results of process.env so that we may understand the environment better.
Full set of reference links to check out at:
Posted at 2020-03-06 by Mrbbp this is the exact code... copy/paste i use minification (esprima), if i remove it, it works. é.
Posted at 2020-03-06 by AkosLukacs Yes, Esprima doesn't like arrow functions :/ Posted at 2020-03-06 by Mrbbp @AkosLukacs i don't minify the code Posted at 2020-03-06 by @gfwilliams Are you using the 'Chrome App' (or native) IDE, rather than https://www.espruino.com/ide/? (the website still works offline!) Exactly this error has been fixed in https://www.espruino.com/ide/ for a while, but the changes may not have made it into the Chrome app yet.
I'd check your settings again. The code in the error message If you turn off minification it'll work. Posted at 2020-03-06 by Mrbbp Hello @gfwilliams i use the Chrome App... (since the first time...) sometime i open the IDE whitout an internet connection, therefore i got into my habits to use the Chrome app. In an old project i have to minify code to put all the code in the pico, i checked the minify option on and never unchecked. As my skills level increase in js, i want to write code in the same way in espruino and web... and arrow function are really cool feature (for me) regards Posted at 2020-03-06 by @gfwilliams Glad that fixed it! The Chrome app will be updated soon, but I'm afraid in about 2-3 months Google will actually remove the Chrome app completely, so you won't have the option! Posted at 2020-03-06 by Mrbbp Oh that’s a bad news! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-03-05 by Mrbbp
if you try this simple example
and upload, i receive :
Beta Was this translation helpful? Give feedback.
All reactions