Uncaught SyntaxError: Got function expected '{'
at line 2 col 14 in .bootcde
setInterval(class function(){LED1.pulse(1,[10,100,10,200,20]);},997);
^
>
.bootcde downloaded from the puck via the web ide:
Sorry - thanks for letting me know! I think this was some UTF8/unicode support that got added erroneously converting pretokenised code. I'll get a fix in now.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
Tips:
Create headers by underlining text with ==== or ----
To *italicise* text put one asterisk each side of the word
To **bold** text put two asterisks each side of the word
Embed images by entering: ![](https://www.google.co.uk/images/srpr/logo4w.png) That's the hard one: exclamation, square brackets and then the URL to the image in brackets.
* Create lists by starting lines with asterisks
1. Create numbered lists by starting lines with a number and a dot
> Quote text by starting lines with >
Mention another user by @username
For syntax highlighting, surround the code block with three backticks:
```
Your code goes here
```
Just like Github, a blank line must precede a code block.
If you upload more than 5 files we will display all attachments as thumbnails.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Looks like the pretokeniser is acting weirdly. Wanted to do some mindless blinking lights, but the code fails if I save to flash.
My code:
The error from the Puck:
.bootcde
downloaded from the puck via the web ide:Output from the browser's JS console when sending (so indeed there are some tokens inside the
setInterval
):The same happens with the default "new tab" code too:
Becomes this when saved to flash:
If I turn off the pretokeniser, it works without any problem.
If I just send it with shift-enter, that works too.
Web IDE v0.79.3
Tested with Puck 1, Espruino 2v23 and 2v22 release. And nRF52840DK, built from latest. Same result.